Why this matters
Integrating a fraction often feels like a dead end. Meet an integral like this and you have no idea where to grab it.
$$\int \frac{3x+1}{(x+1)(x-1)} \, dx$$Here \(\int\) is the long S-shaped integral sign, meaning "add up all the finely sliced pieces," and \(dx\) marks that the direction of that adding is \(x\). The denominator is tangled into a product \((x+1)(x-1)\), so as it stands not a single formula you know applies.
But untangle this fraction into a sum of two smaller fractions like the following, and it suddenly becomes easy.
$$\frac{3x+1}{(x+1)(x-1)} = \frac{1}{x+1} + \frac{2}{x-1}$$This splitting is called partial fraction decomposition. The remarkable thing is that this split always comes out exact. However complicated you make the numerator, as long as the denominator factors into a product, it always divides precisely into a sum like this. Why does it always work out? Is it just luck?
There is one more puzzle. As you integrate these pieces, some fractions produce a logarithm straight away, with no computation. The integral of tangent, for instance.
$$\int \tan x \, dx = -\ln|\cos x| + C$$Here \(\ln\) is the natural logarithm with base \(e\), and \(C\) is the arbitrary constant that always tags along with integration. You integrated a tangent, so why does the logarithm of cosine appear out of nowhere?
Remarkably, these two puzzles are one strand. The reason partial fractions always split is "the number of conditions to match and the number of knobs you can turn are the same from the start," and the reason the logarithm appears is "when the numerator equals the derivative of the denominator, the chain rule run backward gives a logarithm." Both are a single story: turning a fraction into a shape that is easy to integrate.
Partial fractions — why it always splits exactly
First, check that the decomposition above really holds by adding it back up. Putting \(\dfrac{1}{x+1} + \dfrac{2}{x-1}\) over a common denominator,
$$\frac{1}{x+1} + \frac{2}{x-1} = \frac{(x-1) + 2(x+1)}{(x+1)(x-1)} = \frac{3x+1}{(x+1)(x-1)}$$it returns exactly to the original fraction. So how do we find these coefficients \(1\) and \(2\) in the first place? Pretend we do not know them yet and set the numerators of the two pieces as unknowns \(A\), \(B\).
$$\frac{3x+1}{(x+1)(x-1)} = \frac{A}{x+1} + \frac{B}{x-1}$$Multiply both sides by the denominator \((x+1)(x-1)\) and tidy up.
$$3x+1 = A(x-1) + B(x+1)$$Expanding the right and grouping by \(x\) gives \((A+B)\,x + (B-A)\). This must be equal to the left \(3x+1\) for every \(x\), so the parts attached to \(x\) must match, and the plain numbers must match.
$$A+B = 3, \qquad B-A = 1$$There are two unknowns \(A\), \(B\) and two conditions, so solving the two equations gives a single answer, \(A=1\), \(B=2\). In the first screen of the interactive below, you can move \(A\), \(B\) with sliders and find for yourself the moment the sum of the two pieces overlaps the original curve.
Because the "degrees of freedom" match
The key point in that calculation is that the number of unknowns equaled the number of conditions. This is the real reason partial fractions always succeed.
If the denominator is a product of \(n\) distinct linear factors, then \(n\) pieces appear and there are exactly \(n\) unknowns (the numerator of each piece). Meanwhile the numerator is a polynomial of lower degree than the denominator, so there are also \(n\) coefficients to match. There are \(n\) knobs you can turn and \(n\) nails to hit — so it fills in with exactly one answer, neither short nor spare. This balance of "number of knobs = number of nails" is what we call the degrees of freedom matching.
Turn the intuition into a picture. Two nails are set in the wall, and in your hands are two adjusting screws. With only one screw you cannot hit both nails at once and fail; with three screws the answer wobbles among many possibilities. Only when the nails and the screws are both two does it tighten to a single configuration. That partial fractions split "always, and uniquely" is precisely because these counts are designed to match from the start.
Once split this way, the integration suddenly becomes easy. Each piece is of the form \(\dfrac{1}{x-a}\), and this integrates to a logarithm.
$$\int \frac{3x+1}{(x+1)(x-1)}\,dx = \int\frac{1}{x+1}\,dx + \int\frac{2}{x-1}\,dx = \ln|x+1| + 2\ln|x-1| + C$$An integral you could not even touch when tangled turned, the moment it split, into a sum of pieces you know.
Why one piece becomes a logarithm — when the numerator is the denominator's derivative
But why does \(\dfrac{1}{x-a}\) integrate to \(\ln|x-a|\)? Answer this and the second puzzle (the tangent) is solved at the same time.
The key pattern is this. When the numerator is exactly the derivative of the denominator, the integral of that fraction is simply the logarithm of the denominator.
$$\int \frac{f'(x)}{f(x)} \, dx = \ln|f(x)| + C$$Here \(f(x)\) is the denominator and \(f'(x)\) is its derivative. Why does this hold? Differentiate \(\ln|f(x)|\) the other way and it is immediate. By the chain rule, the derivative of the outer log, \(\dfrac{1}{f}\), gets multiplied by the derivative of the inner \(f\), namely \(f'\).
$$\frac{d}{dx}\,\ln|f(x)| = \frac{1}{f(x)} \cdot f'(x) = \frac{f'(x)}{f(x)}$$Differentiating gives \(\dfrac{f'}{f}\), so conversely the integral of \(\dfrac{f'}{f}\) is \(\ln|f|\). This is the same story as substitution where setting \(u=f(x)\) makes \(\int \dfrac{1}{u}\,du = \ln|u|\). The fact that the derivative of \(\ln x\) is exactly \(\dfrac{1}{x}\), from the derivatives of exponentials and logarithms, is the engine behind all of this.
The earlier piece \(\dfrac{1}{x-1}\) is a special case of this pattern too. Differentiating the denominator \(x-1\) gives \(1\), which is exactly the numerator, so it is of the form \(\dfrac{f'}{f}\) as is, and its integral is \(\ln|x-1|\). Here it shows that partial fractions and the log trigger are really siblings born from the same root.
The logarithm of cosine in tangent is no longer strange
Now back to the tangent from the start. Tangent is sine divided by cosine.
$$\int \tan x \, dx = \int \frac{\sin x}{\cos x} \, dx$$Take the denominator as \(f(x) = \cos x\); its derivative is \(f'(x) = -\sin x\). The numerator \(\sin x\) is this derivative with only the sign flipped, \(-f'(x)\). So pulling one minus sign out front makes it exactly of the form \(\dfrac{f'}{f}\).
$$\int \frac{\sin x}{\cos x} \, dx = -\int \frac{-\sin x}{\cos x} \, dx = -\int \frac{f'(x)}{f(x)} \, dx = -\ln|\cos x| + C$$That the logarithm of cosine came out of integrating a tangent was no bolt from the blue. Because the numerator was equal (up to a sign) to the derivative of the denominator, a logarithm was destined to appear from the start. In the second screen of the interactive below, color-match the numerator of several fractions against "the derivative of the denominator" and you see at a glance which fractions fold straight into a logarithm.
In one picture: splitting and the log trigger
The interactive below has two screens.
- Partial fraction matching: the curve of \(\dfrac{3x+1}{(x+1)(x-1)}\) is drawn fixed (gray), and you adjust the sum curve of \(\dfrac{A}{x+1}+\dfrac{B}{x-1}\) with \(A\), \(B\) sliders. Set \(A=1\), \(B=2\) and the two curves overlap exactly, and "match" appears. The conditions \(A+B=3\), \(B-A=1\) are confirmed live too.
- Log trigger: press through several fraction cards and color-match whether the numerator equals "the derivative of the denominator" (up to sign and constant multiple). When they match, the card folds into the form \(\ln\vert\text{denominator}\vert\).
The two screens say one thing. A complicated fraction always splits exactly because the knobs and nails match in number, and any resulting piece — or a fraction whose numerator is the denominator's derivative — becomes a logarithm straight away by running the chain rule backward. Both flow from one principle: turning a fraction into a shape easy to integrate.
The key summary
| Question | Answer |
|---|---|
| Why split a complicated fraction? | Because each single piece becomes an integral you know (a logarithm, etc.) |
| Why does it always split exactly? | Number of unknowns = number of conditions (degrees of freedom match) → a unique answer |
| Why does \(\dfrac{1}{x-a}\) become a logarithm? | The numerator \(1\) is the denominator's derivative, so it is of the form \(\dfrac{f'}{f}\) |
| Why is the integral of \(\dfrac{f'}{f}\) equal to \(\ln\vert f\vert\)? | Because differentiating \(\ln\vert f\vert\) gives \(\dfrac{f'}{f}\) by the chain rule |
| Why is the integral of tangent the logarithm of cosine? | Because \(\sin x\) is \(-1\) times \(\cos x\)'s derivative \(-\sin x\) |
Threaded into one line — when the denominator is a product, the number of unknowns and conditions match so it always splits exactly, and a piece whose numerator is the denominator's derivative becomes, by running the chain rule backward, the logarithm of the denominator.
When you study this with AI
If you miss "why we split like this, and why a logarithm appears," fraction integration feels like memorizing a fresh trick for every problem. When asking an AI, framing the question around the two frames of degrees of freedom (number of unknowns = number of conditions) and whether the numerator is the denominator's derivative threads the scattered tricks into one.
Useful example questions:
- "When splitting \(\dfrac{3x+1}{(x+1)(x-1)}\) into partial fractions, explain via degrees of freedom why there are exactly two unknowns."
- "Explain why \(\displaystyle\int \dfrac{f'(x)}{f(x)}\,dx = \ln|f(x)| + C\) holds, connecting it to the chain rule."
- "Show why \(\displaystyle\int \tan x\,dx\) is \(-\ln|\cos x|\) by comparing the numerator with the denominator's derivative."
Closing
That partial fractions always divide perfectly, and that a logarithm springs from the integral of tangent, look at first like two unrelated, separate tricks. But both flow naturally from a single sentence: turning a fraction into a shape that is easy to integrate. The split succeeds because the knobs and nails match in number, and the logarithm appears simply because the numerator is the denominator's derivative, so running the chain rule backward suffices.
The feel of dividing into pieces by matching the counts of unknowns and conditions, and the eye for recognizing at a glance whether the numerator is the denominator's derivative — grasp these two pictures, and the integration of a complicated fraction is no longer a rule to memorize but a consequence that follows naturally.
Related reading — good to read first: Why the chain rule is "multiplication" · Why integration is the reverse of differentiation · Why a logarithm makes big numbers short → next: Why substitution works no matter what variable you choose · Why integrals carry a + C · Differentiating exponentials and logarithms · draw it yourself: Desmos · Wolfram Alpha