DerivCalc
Written by SilverCodeLabs · Mathematically reviewed · Published October 21, 2026 · How answers are verified

Derivative of ln(x²)

ln(x²) is defined on both sides of zero, and its derivative 2/x holds on both branches—an important difference from 2ln(x), which exists only for x>0.

Answer
2/x (x ≠ 0)
Differentiate with respect to x
Try ln(x²) in the calculator →

Step-by-step solution

1
Identify the layers

Let u=x². The outer function is ln(u), defined when u>0, which here means every x≠0.

2
Differentiate both layers

(ln u)′=1/u and u′=2x, so f′(x)=2x/x².

3
Simplify

Cancel x (allowed because x≠0): f′(x)=2/x. The calculator displays the unsimplified 2x/x², which is the same function on this domain.

Domain and graph behavior

x²>0 for every x≠0, so the domain is all real numbers except 0. The function is even, f(−x)=f(x), so its graph is symmetric about the y-axis, and the derivative 2/x is odd: negative for x<0 (decreasing) and positive for x>0 (increasing). The line x=0 is a vertical asymptote where f→−∞. The graph crosses zero at x=±1, with tangent lines y=2(x−1) and y=−2(x+1).

Second derivative

f″(x)=d/dx(2/x)=−2/x². It is negative for every x in the domain, so both branches are concave down. The calculator's unsimplified second-derivative output (2x²−(2x)²)/x⁴ reduces to the same −2/x².

Common mistake

Do not replace ln(x²) by 2ln(x) without qualification. That log law requires x>0; the correct identity on the full domain is ln(x²)=2ln|x|. Because d/dx ln|x|=1/x for x≠0, the derivative 2/x is valid on both sides. Also do not confuse ln(x²) with (ln x)², whose derivative is 2ln(x)/x.

Practice problems

Differentiate ln(x²+1)

Answer: 2x/(x²+1). Here x²+1>0 for every real x, so there is no excluded point.

Differentiate ln(3x²)

Answer: 2/x. ln(3x²)=ln 3+ln(x²), and the constant ln 3 has derivative zero.

ln(x²) versus 2ln(x)

For positive x the two functions are identical, so their graphs and derivatives coincide on (0, ∞). For negative x, 2ln(x) is undefined, while ln(x²) has a mirror-image branch. Questions that say “differentiate ln(x²) and state where the result is valid” are testing exactly this domain difference; the correct statement is f′(x)=2/x for all x≠0.

ln(x²) versus (ln x)²

Squaring inside the logarithm and squaring the logarithm produce very different functions. ln(x²) equals 2ln|x|; (ln x)² is defined only for x>0, is never negative, and has derivative 2ln(x)·(1/x). At x=e both slopes happen to equal 2/e≈0.736, but at x=e² they differ: 2/e² for ln(x²) versus 4/e² for (ln x)².

A numerical check

At x=2 the formula gives f′(2)=1. A centered secant [ln(2.002²)−ln(1.998²)]/0.004 returns 1.00000. At x=−0.5 the formula gives −4, and the secant agrees. The sign change between the two checks confirms the derivative is odd.

More worked variations

ln(x⁴): 4x³/x⁴=4/x for x≠0.

ln((x−3)²): 2(x−3)/(x−3)²=2/(x−3) for x≠3.

log(x²) (base 10): 2/(x·ln 10) for x≠0.

Questions students ask

Is 2x/x² a wrong answer?

No. It is correct but unsimplified. On the domain x≠0 it equals 2/x, and most courses expect the simplified form.

Why is the derivative negative for negative x?

On the left branch, moving right brings x² closer to 0, so ln(x²) decreases. The derivative 2/x is negative there, matching the graph.

Related logarithmic derivatives

ln(x)ln(2x)log(x)1/xe^(x²)

Review the chain rule, or read our verification method and limitations.