Introduction
Some integrals have a useful pattern: the numerator is the derivative of the function in the denominator, possibly multiplied by a constant. For example, in \(\frac{2x}{x^2+1}\), the denominator \(x^2+1\) has derivative \(2x\), exactly the numerator.
This pattern leads to a logarithm. Recognizing it is an application of substitution as the reverse chain rule: the derivative of a logarithm of a function produces that function’s derivative divided by the function itself. The denominator’s nonzero condition is essential, so we will also keep track of where the resulting antiderivative is valid.
The logarithmic pattern
The numerator must match the derivative of the denominator’s inner function, up to a constant factor. The denominator itself must not be zero on the interval under consideration. If the integrand is undefined at a point, a single antiderivative cannot be defined across that point.
To see the pattern, let \(u=f(x)\). Then \(du=f'(x)\,dx\), so the integral takes the form \(k\int \frac{1}{u}\,du\). Since an antiderivative of \(1/u\) on any interval not containing zero is \(\ln|u|\), substituting back gives the stated result. The derivation is justified in detail below.
Worked examples
Worked Example: A cubic expression in the denominator
Evaluate \(\int \frac{6x^2}{x^3+2}\,dx\), and state where the result is valid.
Set \(u=x^3+2\). Then \(du=3x^2\,dx\), so \(6x^2\,dx=2\,du\). Substitution gives
The denominator is zero when \(x^3+2=0\), or \(x=-\sqrt[3]{2}\). Thus the integrand and antiderivative are valid on intervals that do not cross that point: \((-\infty,-\sqrt[3]{2})\) and \((-\sqrt[3]{2},\infty)\). The constant of integration may be chosen separately on each interval.
Check by differentiating:
This recovers the integrand wherever it is defined.
Worked Example: A constant multiple of the derivative
Evaluate \(\int \frac{6x-12}{x^2-4x+7}\,dx\).
Let \(f(x)=x^2-4x+7\). Its derivative is \(f'(x)=2x-4\), and the numerator satisfies \(6x-12=3(2x-4)=3f'(x)\). Therefore the integrand has the required form with \(k=3\):
Here \(x^2-4x+7=(x-2)^2+3\), which is positive for every real \(x\). The absolute value can therefore be removed, and the antiderivative is valid on all of \(\mathbb{R}\):
Check by differentiation:
The derivative is exactly the original integrand.
Worked Example: A denominator that changes sign
Evaluate \(\int \frac{2x}{x^2-9}\,dx\), specifying the intervals on which an antiderivative is valid.
Choose \(f(x)=x^2-9\), for which \(f'(x)=2x\). The numerator matches \(f'(x)\) without an extra factor, giving
The denominator is zero at \(x=-3\) and \(x=3\). The integrand is therefore defined on the three intervals \((-\infty,-3)\), \((-3,3)\), and \((3,\infty)\). The logarithmic antiderivative applies separately on each interval, with a potentially different constant on each one.
The absolute value cannot be omitted from a formula covering all three intervals: \(x^2-9\) is negative when \(-3<x<3\). To check the answer on any of these intervals, differentiate:
This equality holds wherever \(x^2-9\ne0\), exactly the domain of the integrand.
Why the rule works
The formula follows directly from the chain rule. On an interval where \(f(x)\ne0\), the sign of \(f(x)\) does not change: if it changed sign, continuity would force \(f\) to be zero somewhere between the two values. Thus, on that interval, either \(f(x)>0\) throughout or \(f(x)<0\) throughout. In either case, \(\ln|f(x)|\) is defined and differentiable.
For a positive input \(y\), the derivative of \(\ln y\) is \(1/y\). Applying the chain rule to the absolute-value expression on an interval where \(f\) has fixed nonzero sign gives the following calculation.
Since \(f\) is nonzero on the interval, \(\ln|f(x)|\) is defined there.
Whether \(f\) is positive or negative, the derivative of \(\ln|f(x)|\) is \(f'(x)/f(x)\).
Multiplying the logarithm by \(k\) multiplies its derivative by \(k\).
This proves the integration rule: the expression on the left is an antiderivative of the integrand on the right wherever \(f(x)\ne0\). Equivalently, substitution \(u=f(x)\) reduces the integral to \(k\int \frac{1}{u}\,du\); the chain-rule calculation verifies that substituting back produces an antiderivative in \(x\).
Recognizing the match and tracking the domain
When inspecting an integrand, identify the function in the denominator and differentiate it. Then compare that derivative with the numerator. If the numerator is a constant multiple \(k\) of the derivative, the logarithmic rule applies. If it is not, this pattern does not by itself evaluate the integral.
For instance, in \(\frac{5x}{x^2+4}\), the denominator’s derivative is \(2x\), so the numerator is \(\frac{5}{2}\) times that derivative. The factor \(\frac{5}{2}\) must remain in the answer. By contrast, a numerator with a different dependence on \(x\) does not match merely because the denominator is a function of \(x\).
For a real-valued logarithm, the input to \(\ln\) must be positive. That is why the formula uses \(\ln|f(x)|\), not simply \(\ln(f(x))\), when \(f\) may be negative. The absolute value makes the logarithm’s input positive at every point where \(f\ne0\), but it does not make the expression defined where \(f=0\).
A common mistake: losing the constant factor
A frequent error is to write \(\ln(f(x))+C\) without checking whether its derivative equals the integrand. For example, consider \(\int \frac{4x}{x^2+5}\,dx\). Since the derivative of \(x^2+5\) is \(2x\), the numerator \(4x\) is twice that derivative.
The incorrect calculation \(\int \frac{4x}{x^2+5}\,dx=\ln(x^2+5)+C\) fails when checked:
The correct calculation keeps the factor of \(2\):
Because \(x^2+5>0\) for every real \(x\), this expression is defined on all of \(\mathbb{R}\). Its derivative confirms the correction:
Why this pattern matters
Recognizing \(f'(x)/f(x)\) lets you integrate a broad family of expressions without expanding, factoring, or otherwise changing the function. The same structure appears whenever a quantity is multiplied by the derivative of its denominator. The method is reliable when both parts of the match are checked: the numerator must be the correct constant multiple, and the denominator function must stay nonzero on the interval.
A useful final check is to differentiate the proposed answer. It reveals a missing constant factor and confirms that the result applies on the stated domain. It also reminds you that a formula for an indefinite integral describes antiderivatives on intervals where the original integrand is defined.
Check Your Understanding
For each question, identify the derivative match and pay attention to where the denominator is nonzero.
- Evaluate \(\int \frac{8x^3}{2x^4+1}\,dx\). What substitution reveals the logarithmic pattern?
- Evaluate \(\int \frac{3}{3x+2}\,dx\), and check the constant factor by differentiation.
- On which intervals is \(\int \frac{2x}{x^2-16}\,dx\) defined? Write an antiderivative valid on each interval.
- Why is \(\ln|f(x)|\) appropriate when \(f(x)\) may be negative?
- A proposed antiderivative is \(\ln(x^2+1)+C\) for \(\frac{6x}{x^2+1}\). Differentiate the proposed answer and correct it.