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
- 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
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}.
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:
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},
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:
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
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
- Writing \frac{1}{x^2}. You must multiply by the inside derivative 2x.
- Treating \ln^2 x as \ln(x^2). One squares the output, the other the input.
- 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