practicecalculus
Exponential and log derivatives

Derivative of ln(x²) vs (ln x)²: Formulas and Examples

The derivative of ln(x²) is 2/x, while the derivative of (ln x)² is 2 ln x / x. See both proofs, a graph and how to tell them apart.

Exponential and log derivatives Updated 2 min read

At a glance

\frac{d}{dx}\,\ln(x^2) = \frac{2}{x}
Derivative of ln(x²)
\dfrac{2}{x} for x \ne 0
Derivative of (ln x)²
\dfrac{2\ln x}{x} for x > 0
Key log rule
\ln(x^2) = 2\ln\lvert x\rvert
Domain of ln(x²)
x \ne 0
Domain of (ln x)²
x > 0
On this page
  1. Derivative of ln(x²): two ways
  2. Derivative of (ln x)²
  3. Graph of both functions
  4. Side by side
  5. More examples
  6. Common mistakes

The derivative of \ln(x^2) is \dfrac{2}{x}. Do not confuse it with (\ln x)^2, whose derivative is \dfrac{2\ln x}{x}.

\frac{d}{dx}\,\ln(x^2) = \frac{2}{x} \qquad\qquad \frac{d}{dx}\,(\ln x)^2 = \frac{2\ln x}{x}

Derivative of ln(x²): two ways

With the chain rule. The inside is u = x^2, so u' = 2x. Using "derivative of the inside over the inside" from the derivative of ln x:

\frac{d}{dx}\ln(x^2) = \frac{2x}{x^2} = \frac{2}{x}

With a log rule first. The power rule for logs brings the exponent down: \ln(x^2) = 2\ln\lvert x\rvert. Since \frac{d}{dx}\ln\lvert x\rvert = \frac{1}{x},

\frac{d}{dx}\,2\ln\lvert x\rvert = \frac{2}{x}

The absolute value matters because x^2 > 0 even when x < 0. So \ln(x^2) exists for negative x too, and the formula \frac{2}{x} is valid on both sides of 0.

Derivative of (ln x)²

Here the log is computed first and then squared. The outer function is a square, so use the chain rule with the power rule outside:

\frac{d}{dx}(\ln x)^2 = 2(\ln x)^1\cdot\frac{d}{dx}\ln x = \frac{2\ln x}{x}

You will also see (\ln x)^2 written as \ln^2 x. It never equals \ln(x^2) in general. At x = e: \ln(e^2) = 2, but (\ln e)^2 = 1.

Graph of both functions

Graph of y = ln(x²) and y = (ln x)²
\ln(x^2) has two branches, one on each side of the y-axis. (\ln x)^2 lives only on x > 0, touches zero at x = 1 and is never negative.

The graph shows the difference in sign. \ln(x^2) rises for x > 0 (its slope \frac{2}{x} is positive) and falls for x < 0. (\ln x)^2 has a minimum at x = 1, where its derivative \frac{2\ln x}{x} equals 0.

Side by side

\ln(x^2) (\ln x)^2
What is squared the input x the output \ln x
Domain x \ne 0 x > 0
Simplifies to 2\ln\lvert x\rvert no simpler form
Derivative \frac{2}{x} \frac{2\ln x}{x}
Value at x = e 2 1

More examples

Example 1. \frac{d}{dx}\ln(x^3) = \frac{3x^2}{x^3} = \frac{3}{x}. In general \frac{d}{dx}\ln(x^n) = \frac{n}{x}.

Example 2. \frac{d}{dx}\ln(x^2 + 1) = \frac{2x}{x^2 + 1}. Here nothing cancels, because the inside is not a pure power.

Example 3. \frac{d}{dx}(\ln x)^3 = \frac{3(\ln x)^2}{x}.

Example 4. \frac{d}{dx}\ln\!\left((x^2 + 1)^2\right) = 2\cdot\frac{2x}{x^2 + 1} = \frac{4x}{x^2 + 1}, using the log power rule first.

Common mistakes

  1. Writing \frac{1}{x^2}. You must multiply by the inside derivative 2x.
  2. Treating \ln^2 x as \ln(x^2). One squares the output, the other the input.
  3. Writing \frac{2}{x} for (\ln x)^2. You dropped the \ln x that the power rule leaves behind.

For more chain rule practice with logs, see the derivative of ln(2x), logarithmic differentiation and derivatives of exponential and logarithmic functions.

Practice it now

Chain rule: any function

Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.

Practice this lesson

Frequently asked questions

What is the derivative of ln(x²)?

The derivative of \ln(x^2) is \frac{2x}{x^2} = \frac{2}{x}, for every x \ne 0.

What is the derivative of (ln x)²?

By the chain rule, 2\ln x\cdot\frac{1}{x} = \frac{2\ln x}{x}.

Is ln(x²) the same as 2 ln x?

Only for x > 0. In general \ln(x^2) = 2\ln\lvert x\rvert, because \ln(x^2) is also defined for negative x while \ln x is not.

What is the derivative of ln(x² + 1)?

It is \frac{2x}{x^2 + 1}. Unlike \ln(x^2), this does not simplify further.

Written by the PracticeCalculus team

We build interactive calculus lessons and write every page to be clear and correct. Spotted something off? Tell us and we will fix it.