Integrals of f′ over f

A logarithm hiding in a fraction.

The derivative of ln f

By the chain rule, ln f(x) differentiates to 1/f(x), the derivative of ln at f(x), times f'(x), the derivative of the inside. So the derivative of ln f(x) is f'(x)/f(x): a fraction whose numerator is the derivative of its denominator.

For example, ln(x² + 1) differentiates to 2x/(x² + 1), and ln(sin x) to (cos x)/(sin x).

Read backwards

Reading that the other way gives an integral: ∫ f'(x)/f(x) dx = ln|f(x)| + C. The absolute value is there for the same reason as in ln|x|: f(x) may be negative, and ln|f(x)| still differentiates to f'(x)/f(x).

The numerator has to be exactly the derivative of the denominator, or a constant multiple of it, as below. Anything else and the pattern does not apply.

Checking the numerator

Take ∫ 2x/(x² + 1) dx. The denominator x² + 1 differentiates to 2x, which is the numerator, so the integral is ln(x² + 1) + C. No absolute value is needed, since x² + 1 is always positive.

Definite integrals follow. From 1 to 3 the value is ln 10 − ln 2 = ln 5 ≈ 1.609. From 0 to 2 it is ln 5 − ln 1 = ln 5 as well, so the two regions have the same area.

xy

The gold curve is y = 2x/(x² + 1), shaded from x = 0 to x = 2. The plain curve is y = ln(x² + 1), which starts at 0. Its height at x = 2 is ln 5 ≈ 1.609, the shaded area, because the area from 0 up to any x is ln(x² + 1) − ln 1.

Adjusting a constant

The skill is the check: differentiate the denominator first, then compare it with the numerator. In 3x²/(x³ + 5) the denominator differentiates to 3x², the numerator exactly, so the integral is ln|x³ + 5| + C.

A numerator that is a constant multiple of the derivative works too, with the constant fixed outside. In x/(x² + 4), the denominator differentiates to 2x, and x is ½ of 2x. So ∫ x/(x² + 4) dx = ½ ∫ 2x/(x² + 4) dx = ½ ln(x² + 4) + C. The integral from 0 to 2 is ½(ln 8 − ln 4) = ½ ln 2 ≈ 0.347.

In the same way, x³ + 1 differentiates to 3x², and x² is a third of that: ∫ x²/(x³ + 1) dx = ⅓ ln|x³ + 1| + C. From 0 to 1 that is ⅓ ln 2 ≈ 0.231.

The pattern in other families

The denominator need not be a polynomial. sin x differentiates to cos x, so ∫ (cos x)/(sin x) dx = ln|sin x| + C. eˣ + 1 differentiates to eˣ, so ∫ eˣ/(eˣ + 1) dx = ln(eˣ + 1) + C.

tan x is (sin x)/(cos x), and cos x differentiates to −sin x, so the numerator is minus the derivative of the denominator. The minus comes outside: ∫ tan x dx = −ln|cos x| + C.

When it does not fit

Only a constant factor can be adjusted. In x/(x³ + 1), the denominator differentiates to 3x², and x is not a constant times x², so the pattern fails. The difference is a factor of x, and moving a variable outside the integral is not allowed.

In 1/(x² + 1), the denominator differentiates to 2x, and the numerator 1 has no x at all. That integral is tan⁻¹x + C, not a logarithm. A denominator that factors, such as x² − 1 with a numerator of 1, is split into partial fractions instead.

The usual mistakes

Answering 1/f. 1/(x² + 1) differentiates to −2x/(x² + 1)², which has a squared denominator; the integral of 2x/(x² + 1) is ln(x² + 1) + C.

Taking the log of the numerator. ln|cos x| differentiates to −(sin x)/(cos x), not (cos x)/(sin x). The log is always of the denominator.

Fixing the constant the wrong way. The numerator x is ½ of 2x, so the answer carries ½, not 2: ½ ln(x² + 4) + C.

Forcing the pattern where a variable is missing. Any multiple k ln|x³ + 1| differentiates to 3kx²/(x³ + 1), with x² on top, never x, so no multiple of ln|x³ + 1| is the integral of x/(x³ + 1).

Practice Integrals of f′ over f in the app