Rewrite before integrating
Topic 6.8 gives basic antiderivatives for powers of \(x\), \(\sin x\), \(\cos x\), \(\sec^2 x\), \(e^x\) and \(\frac{1}{x}\), and substitution (topic 6.9) extends them to inner functions. Many integrands match none of these as written, such as a fraction of polynomials, a root in a denominator, or \(\sin^2 x\). Algebra or an identity can often write such an integrand as a sum of terms that each have a basic antiderivative. This topic shows which rewrites to use, why they leave the integral unchanged, and where they hold.
A new formula for the same curve
The graph of f of x equals (x squared + 3x + 3) over (x + 1), for x from −3 to 3, with a dashed vertical line at x = −1, where the curve has no value. To the right of the line, the curve comes down from the top of the figure to its lowest point, 3, at x = 0 and then rises. To the left of the line, the curve lies below the axis and falls past the bottom of the figure as it nears the line. An orange dashed curve, x + 2 + 1 over (x + 1), lies on the curve. The region under the curve from 0 to 2 is split into a teal band under the line y = x + 2, labeled 6, and a thin green band between that line and the curve, labeled ln 3. A button moves the left end of the region to −2, across the dashed line: the region then extends past the top of the figure in teal to the right of the line and past the bottom in red to the left of it.
The curve in Figure 1 is the graph of
The degree of a polynomial is its highest power of \(x\). The top of \(f\), its numerator, has degree 2, and the bottom, its denominator, has degree 1. No basic rule fits this fraction. Divide the top by the bottom, as in long division of numbers. Each step subtracts the multiple of the bottom that removes the highest power, until what is left has a lower degree than the bottom:
The quotient is \(x+2\), and the remainder is 1. For \(x\ne -1\), divide both sides by \(x+1\):
In Figure 1, the orange dashed curve draws this new formula. It lies on the curve, because the two formulas have the same value at every \(x\ne -1\). At \(x=-1\), neither has a value, and the dashed vertical line marks that input.
Two functions that have the same value at every \(x\) of an interval have the same integral over it. Each Riemann sum of one (topic 6.3) equals the matching sum of the other, because the heights at the sample points are equal. On an interval where they agree, they also have the same antiderivatives, because a derivative that equals one equals the other. You can therefore integrate the new formula instead of \(f\). The integral of a sum is the sum of the integrals (topic 6.6), so each term gives its own region. In Figure 1, the teal band lies under the line \(y=x+2\). The green band between that line and the curve adds area, because \(\frac{1}{x+1}\) is positive on \([0,2]\).
On \([0,2]\), \(f\) is continuous, because \(x+1\ne 0\) there. The substitution \(u=x+1\) gives the antiderivative \(\ln|x+1|\) for the last term, so \(F(x)=\frac{x^2}{2}+2x+\ln|x+1|\) is an antiderivative of \(f\). By the Fundamental Theorem of Calculus, Part 2 (topic 6.7),
The two terms are the areas of the teal band and the green band.
The theorem needs \(f\) to be continuous on the whole interval. Use the button under Figure 1 to move the left end of the region to \(-2\). The region now crosses the dashed line. As \(x\) approaches \(-1\) from the right, the curve rises past the top of the figure, and from the left, it falls past the bottom. The region does the same, teal above the axis and red below it, where area counts as negative. Because \(f\) has no value at \(-1\), the theorem does not apply on \([-2,2]\), and \(F(2)-F(-2)=8+\ln 3\) is not the signed area of this region.
The same steps rewrite any fraction \(\frac{P}{Q}\) of polynomials whose top has at least the degree of the bottom. Long division gives a quotient \(S\) and a remainder \(R\) with \(P=QS+R\), where \(R\) is 0 or has a lower degree than \(Q\). Wherever \(Q\ne 0\), dividing both sides by \(Q\) writes the fraction as \(S\) plus \(\frac{R}{Q}\). If the bottom is \(ax+b\), with \(a\ne 0\), the remainder is a constant. The substitution \(u=ax+b\), with \(du=a\,dx\), then gives \(\frac{1}{a}\ln|ax+b|\) as an antiderivative of \(\frac{1}{ax+b}\).
If the top and the bottom share a factor \(x-c\), cancel it. The fraction has no value at \(c\), because its bottom is 0 there, but the canceled form can have one. Write \(x\ne c\) with the canceled form. It equals the fraction wherever the fraction has a value.
Powers and trigonometric identities
For \(x>0\), a root is a power with a fractional exponent, \(\sqrt[n]{x^m}=x^{m/n}\), and a power in a denominator has a negative exponent, \(\frac{1}{x^p}=x^{-p}\). The power rule integrates one power of \(x\) at a time, so expand every product and every whole-number power of a sum first. If the bottom is a single power of \(x\), divide each term of the top by it. Each term is then a constant times a power of \(x\). The power rule of topic 6.8 integrates every such term except \(x^{-1}\), whose antiderivative is \(\ln|x|\).
A trigonometric identity is also a rewrite, because it holds at every \(x\) where both sides have a value. Dividing \(\sin^2 x+\cos^2 x=1\) by \(\cos^2 x\) gives \(\tan^2 x+1=\sec^2 x\) wherever \(\cos x\ne 0\). This Pythagorean identity replaces \(\tan^2 x\) by \(\sec^2 x-1\), and \(\sec^2 x\) has the antiderivative \(\tan x\). The double-angle identity
solved for each square, gives the half-angle identities \(\sin^2 x=\frac12(1-\cos 2x)\) and \(\cos^2 x=\frac12(1+\cos 2x)\), which some books call power-reducing identities. Each replaces a square by a constant and a multiple of \(\cos 2x\), which has the antiderivative \(\frac12\sin 2x\) by the substitution \(u=2x\).
The graph of y = sin squared x from 0 to pi: a hump that rises from 0 to 1 at pi over 2 and falls back to 0 at pi, with an orange dashed curve, one half minus one half cos 2x, lying on it. The region under the curve is drawn as a teal rectangle of height one half from 0 to pi. Near 0 and near pi, where the curve is below one half, red regions cover the top of the rectangle between the curve and the line y = one half. Between pi over 4 and 3 pi over 4, where the curve is above that line, a green region sits on top of the rectangle.
In Figure 2, the rewrite \(\sin^2 x=\frac12-\frac12\cos 2x\) splits the region under the curve from 0 to \(\pi\). The teal rectangle lies under the line \(y=\frac12\), the constant term. The term \(-\frac12\cos 2x\) gives the height of the curve above that line, negative where the curve is below it. Where the curve is above the line, the green region adds area. Where it is below, the red regions are area that the rectangle covers but the curve does not, so their area is subtracted. Over \([0,\pi]\), the integral of \(\cos 2x\) is \(\frac12\sin 2\pi-\frac12\sin 0=0\), so the red and green areas cancel. The area under \(\sin^2 x\) from 0 to \(\pi\) is therefore the area of the rectangle, \(\frac{\pi}{2}\).
Completing the square
A quadratic bottom with no real zeros does not factor, and division does not help when the top has the lower degree. Complete the square instead, as in \(x^2+6x+10=(x+3)^2+1\). If the coefficient of \(x^2\) is 1, the number after the square is positive, since otherwise the bottom would be 0 for some \(x\). The bottom then has the form \((x-h)^2+k^2\) with \(k>0\). Topic 3.4 found that the derivative of \(\arctan u\) is \(\frac{1}{1+u^2}\), so \(\arctan u\) is an antiderivative of \(\frac{1}{1+u^2}\). Factor \(k^2\) out of the bottom. Then substitute \(u=\frac{x-h}{k}\), so that \(dx=k\,du\):
The right side is \(\frac{1}{k}\arctan u+C\), with \(u=\frac{x-h}{k}\). For \(x^2+6x+10\), \(h=-3\) and \(k=1\), so an antiderivative is \(\arctan(x+3)\). A logarithm appears instead when the top is a multiple of the derivative of the bottom, as in \(\frac{2x+6}{x^2+6x+10}\).
Example 1
Divide or cancel algebraic factors
Evaluate \(\displaystyle\int_2^5 \frac{x^2-x-2}{x^2-1}\,dx\).
Solution
The bottom is 0 at \(x=1\) and \(x=-1\). Neither lies in \([2,5]\), so the integrand is continuous on the interval. Factor the top and the bottom:
For \(x\ne -1\), the common factor \(x+1\) cancels. The new top and bottom have the same degree, and \(x-2=(x-1)-1\), so division gives a quotient of 1 and a remainder of \(-1\):
Both rewrites hold at every \(x\) in \([2,5]\). The substitution \(u=x-1\) gives the antiderivative \(\ln|x-1|\) of \(\frac{1}{x-1}\), so
Example 2
Rewrite radicals and powers
Evaluate \(\displaystyle\int_1^4 \frac{\left(\sqrt{x}+1\right)^2}{\sqrt{x}}\,dx\).
Solution
The integrand is continuous on \([1,4]\), because \(\sqrt{x}>0\) there. With the root written as a power, the square expands to three terms:
The bottom is the single power \(x^{1/2}\). Dividing each term by it subtracts \(\frac12\) from each exponent, where \(1=x^0\):
No exponent is \(-1\), so the power rule integrates each term:
Example 3
Recognize a useful trig identity
Evaluate \(\displaystyle\int_0^{\pi/4} \tan^2 x\,dx\).
Solution
On \(\left[0,\frac{\pi}{4}\right]\), \(\cos x\ge\frac{\sqrt2}{2}\), so \(\tan^2 x\) is continuous and the Pythagorean identity holds there. No basic rule fits \(\tan^2 x\), but the identity rewrites it with \(\sec^2 x\), which has the antiderivative \(\tan x\):
Example 4
Integrate the rewritten expression
Find \(\displaystyle\int \frac{dx}{x^2-4x+13}\).
Solution
The top has the lower degree, so division does not help. Complete the square:
The bottom is at least 9, so it has no zeros and does not factor, and the integrand is continuous for every \(x\). The bottom has the form \((x-h)^2+k^2\) with \(h=2\) and \(k=3\), so
To test the answer, differentiate it with the chain rule:
The result is the integrand, because \(9+(x-2)^2=x^2-4x+13\).
Each example is one of the four skills of topic 6.10 in Which & Why: AP Calculus.