Unit 6 · Topic 6.8

Find an antiderivative

Builds on the basic derivative rules, the chain rule and the Mean Value Theorem. 13 minutes.

  1. Example 1Find an antiderivative of a power or sum
  2. Example 2Use basic trig, exponential, and logarithmic antiderivatives
  3. Example 3Include the integration constant
  4. Example 4Determine a particular antiderivative
  5. Example 5Check an antiderivative

An antiderivative of a function \(f\) on an interval is a function \(\cb{F}\) whose derivative is \(f\) at every point of the interval:

\[\cb{F}'(x)=f(x)\]

The derivative of \(x^2\) is \(2x\), so \(x^2\) is an antiderivative of \(2x\). This topic shows that one antiderivative gives all the others, and that one known value picks out a single antiderivative. It finds antiderivatives by reading the derivative rules backward, and it checks them by differentiating.

Antiderivatives differ by a constant

Top: the line y = 2x through the origin, with orange lines from the axis to the line at x = −1.5, −0.5, 0.5 and 1.5. Below: five faint parabolas y = x² + C, for C = −2, −1, 0, 1 and 2, one above another, and a teal parabola that a slider moves up and down. Short orange segments lie along the teal parabola at the same four inputs, with slopes −3, −1, 1 and 3. A button marks a point on the highest faint parabola with a ring around a dot and joins it to the teal parabola with a red vertical segment, and a second button moves the teal parabola up until it passes through the point.

Figure 1The orange lines on the top graph give the height of \(f(x)=2x\) at four inputs, and the orange segments below have these heights as slopes. The teal curve is \(x^2+C\) for the value of \(C\) on the slider, and the faint curves are \(x^2+C\) for \(C=-2\), \(-1\), 0, 1 and 2. The button Mark a point puts a ring around a dot at a point. A red segment then shows how far the teal curve misses it.

In Figure 1, the top graph is \(f(x)=2x\), and orange lines mark its height at four inputs. The teal curve below is \(\cb{x^2}\). At each of the four inputs, a short orange segment on the teal curve has the height of \(f\) there as its slope. The curve runs along every segment, because its slope at each \(x\) is \(\cy{2x}\).

Move the slider \(C\). The teal curve becomes \(\cb{x^2+C}\), the same parabola moved up or down, and the segments move with it and still lie along it. A vertical shift does not tilt a curve. In symbols, a constant has derivative 0 (topic 2.6), so for any antiderivative \(F\) of \(f\),

\[\frac{d}{dx}\big(F(x)+C\big)=f(x)+0=f(x)\]

Each faint curve is \(x^2+C\) for one value of \(C\), so it is an antiderivative of \(2x\) too.

On an interval, there are no other antiderivatives. Suppose that \(F\) and \(H\) are antiderivatives of \(f\) on an interval \(I\). Then \(H-F\) has derivative \(f-f=0\) at every point of \(I\). Take any two points \(p<q\) of \(I\). Because \(I\) is an interval, it contains every number between them, so \(H-F\) is differentiable on \([p,q]\), and therefore continuous there (topic 2.4). By the Mean Value Theorem (topic 5.1), the average rate of \(H-F\) over \([p,q]\) equals its derivative at some point between them. That derivative is 0, so the average rate is 0, and \(H-F\) has the same value at \(q\) as at \(p\).

Because \(p\) and \(q\) are any two points of \(I\), the difference has one value \(C\) on all of \(I\), and \(H=F+C\). Two antiderivatives of one function on an interval therefore differ by a constant, a corollary of the Mean Value Theorem that topic 5.9 also proves.

On an interval, the family of all antiderivatives of \(f\) is the indefinite integral of \(f\), written \(\int f(x)\,dx=F(x)+C\). The function \(f\) is the integrand, \(dx\) names the variable, and \(C\), the constant of integration, stands for any real number. An indefinite integral is a family of functions, while a definite integral is a number. A definite integral needs no \(C\), because \(C\) cancels in the difference \(\big(F(q)+C\big)-\big(F(p)+C\big)\) of the Fundamental Theorem of Calculus, Part 2 (topic 6.7).

A single known value picks out one antiderivative. Press Mark a point under Figure 1. A ring around a dot marks a point \((x_0,y_0)\). The red segment at \(x_0\) joins the teal curve to this point, so its length is the change in \(C\) that the curve needs. If the antiderivative must have the value \(y_0\) at \(x_0\), a condition called an initial condition, then \(F(x_0)+C=y_0\), which gives one value of \(C\):

\[C=y_0-F(x_0)\]

Press Move the curve through the point. The teal curve moves onto the faint curve through the point. The result, \(F(x)+y_0-F(x_0)\), is a particular antiderivative, while \(F(x)+C\) is the general antiderivative. Each antiderivative step adds one constant, so a function found from its second derivative needs two values.

Derivative rules read backward

Every derivative rule, read backward, gives an antiderivative. By the power rule (topic 2.5), for every rational number \(n\neq-1\) and every \(x\neq0\) where \(x^n\) is defined,

\[\frac{d}{dx}\,\frac{x^{n+1}}{n+1}=\frac{(n+1)\,x^n}{n+1}=x^n\]

If \(n\) is a whole number, this also holds at \(x=0\). It holds there for the other positive values of \(n\) too, because at 0 the difference quotient of \(\frac{x^{n+1}}{n+1}\) is \(\frac{x^n}{n+1}\), which approaches \(0^n=0\). An antiderivative of \(x^n\) therefore comes from raising the exponent by one and dividing by the new exponent. Some books call this rule the power rule for antiderivatives. It needs \(n\neq-1\), because the divisor \(n+1\) would be 0. Write a root or a reciprocal as a power first, as in \(\sqrt{x}=x^{1/2}\) and \(\frac{1}{x^3}=x^{-3}\).

Constant factors and sums carry over from the derivative rules (topic 2.6). If \(F\) and \(G\) are antiderivatives of \(f\) and \(g\), and \(k\) is a constant, then \((kF+G)'=kf+g\). An antiderivative of a sum is therefore found term by term, with each constant factor kept in front. One \(C\) at the end collects the constants of all the terms. Products and quotients have no such rule, because their derivatives are not the products or quotients of derivatives (topics 2.8 and 2.9).

For the exponent \(-1\), a logarithm takes the place of a power. The derivative of \(\ln x\) is \(\frac1x\) for \(x>0\) (topic 2.7), but \(\ln x\) has no values for \(x<0\). There, the chain rule (topic 3.1) gives

\[\frac{d}{dx}\ln(-x)=\frac{1}{-x}\cdot(-1)=\frac{1}{x}\]

Because \(|x|\) is \(x\) for \(x>0\) and \(-x\) for \(x<0\), the two cases combine, and \(\ln|x|\) has derivative \(\frac1x\) at every \(x\neq0\).

Top: the graph of 1 over x, in two pieces on either side of x = 0, below the axis for x < 0 and above it for x > 0, with orange lines from the axis to the graph at x = −2.2, −0.8, 0.8 and 2.2. Below: two teal curves, the natural logarithm of the absolute value of x plus C₁ for x < 0 and plus C₂ for x > 0. Each falls steeply toward x = 0 and is a mirror image of the other when C₁ = C₂. Short orange segments lie along them at the same four inputs. Two sliders move the left curve and the right curve up and down separately.

Figure 2The orange lines on the top graph give the height of \(\frac1x\) at four inputs, and the orange segments below have these heights as slopes. The teal curves are \(\ln|x|+C_1\) for \(x<0\) and \(\ln|x|+C_2\) for \(x>0\), and each slider moves one of them.

In Figure 2, the top graph is \(\frac1x\), in two pieces, because it has no value at 0. The teal curves below are \(\cb{\ln|x|+C_1}\) for \(x<0\) and \(\cb{\ln|x|+C_2}\) for \(x>0\), and the orange segments on them have the heights of \(\frac1x\) as slopes. With \(C_1=C_2\), the left curve is the mirror image across \(x=0\) of the right one, which is \(\ln x\) moved by \(C_2\).

Move the two sliders by different amounts. Each curve moves by itself, and the segments still lie along both. The domain of \(\frac1x\) is two intervals with a gap at 0. The argument above cannot compare points of the two intervals, because \([p,q]\) would then contain 0, where \(\frac1x\) has no value. Each interval has its own constant, and \(\ln|x|+C\) gives the antiderivatives on one interval at a time.

The other basic antiderivatives come from derivatives in the same way. The derivatives of \(\sin x\) and \(-\cos x\) are \(\cos x\) and \(\sin x\) (topic 2.7), so \(\sin x\) is an antiderivative of \(\cos x\), and \(-\cos x\) is one of \(\sin x\). By topic 2.10, the derivatives of \(\tan x\), \(\sec x\), \(-\cot x\) and \(-\csc x\) are \(\sec^2x\), \(\sec x\tan x\), \(\csc^2x\) and \(\csc x\cot x\). By topic 2.7, \(e^x\) is its own derivative, and \(a^x\) has derivative \(a^x\ln a\). For a base \(a>0\) other than 1, \(\ln a\neq0\), so \(\frac{a^x}{\ln a}\) has derivative \(a^x\). By topic 3.4, \(\arctan x\) has derivative \(\frac{1}{1+x^2}\), and \(\arcsin x\) has derivative \(\frac{1}{\sqrt{1-x^2}}\) for \(-1<x<1\).

Because an antiderivative is defined by its derivative, you can check any answer by differentiating it. The result must equal the integrand at every \(x\) of the interval, so compare the two formulas, not their values at one input. Differentiation can confirm an antiderivative that you cannot find, but it never finds \(C\), because \(C\) has derivative 0. A function that is continuous on an interval always has an antiderivative there, by the Fundamental Theorem of Calculus, Part 1 (topic 6.4). For some functions, such as \(e^{-x^2}\), no antiderivative can be written with the functions of this course.

Example 1

Find an antiderivative of a power or sum

Find \(\displaystyle\int\left(12x^5-\frac{15}{x^4}+7\sqrt{x}\right)dx\) for \(x>0\).

Solution

The integrand is defined for \(x>0\), which is one interval, so one constant \(C\) describes all its antiderivatives there. As powers of \(x\), its terms are \(12x^5\), \(-15x^{-4}\) and \(7x^{1/2}\). Their new exponents are 6, \(-3\) and \(\frac32\), and each term is divided by its new exponent:

\[\begin{aligned}12\cdot\frac{x^6}{6}&=2x^6\\-15\cdot\frac{x^{-3}}{-3}&=5x^{-3}\\7\cdot\frac{x^{3/2}}{3/2}&=\frac{14}{3}x^{3/2}\end{aligned}\]

The divisor \(-3\) is negative, so the middle term changes sign. Dividing by \(\frac32\) multiplies by \(\frac23\), so the last coefficient is \(7\cdot\frac23\). The antiderivatives are the sum of the three results and one constant:

\[\begin{aligned}&\int\left(12x^5-\frac{15}{x^4}+7\sqrt{x}\right)dx\\&=2x^6+\frac{5}{x^3}+\frac{14}{3}x^{3/2}+C\end{aligned}\]

Example 2

Use basic trig, exponential, and logarithmic antiderivatives

Find \(\displaystyle\int\left(4\sin x-\frac{3}{x}+2e^x\right)dx\) for \(x<0\).

Solution

The integrand is defined at every \(x<0\), which is one interval, so one constant \(C\) is enough. Each term is a constant times a basic function, and each constant stays in front. The derivative of \(\cos x\) is \(-\sin x\), so \(-\cos x\) is an antiderivative of \(\sin x\). The derivative of \(\ln|x|\) is \(\frac1x\), and \(e^x\) is its own derivative, so

\[\begin{aligned}&\int\left(4\sin x-\frac{3}{x}+2e^x\right)dx\\&=-4\cos x-3\ln|x|+2e^x+C\end{aligned}\]

On this interval \(|x|=-x\), so \(\ln|x|=\ln(-x)\), which is defined because \(-x>0\).

Example 3

Include the integration constant

One student writes \(\displaystyle\int 2\sin x\cos x\,dx=\sin^2x+C\). Another writes \(\displaystyle\int 2\sin x\cos x\,dx=-\cos^2x+C\). Show that both answers are correct.

Solution

The integrand is defined for all real numbers, which form one interval, so its antiderivatives differ by constants. By the chain rule, the derivatives of the two answers are

\[\begin{aligned}\frac{d}{dx}\sin^2x&=2\sin x\cdot\cos x\\\frac{d}{dx}\big(-\cos^2x\big)&=-2\cos x\cdot(-\sin x)\end{aligned}\]

Both equal the integrand, so both functions are antiderivatives. Their difference is a constant, as it must be:

\[\begin{aligned}\sin^2x-\big(-\cos^2x\big)&=\sin^2x+\cos^2x\\&=1\end{aligned}\]

Adding \(C\) gives \(\sin^2x+C=-\cos^2x+(C+1)\). As \(C\) runs through all real numbers, so does \(C+1\), and the two answers describe the same family.

Example 4

Determine a particular antiderivative

A particle moves along a line with acceleration \(6t+2\) meters per second squared at time \(t\) seconds. Its velocity at \(t=0\) is \(-5\) meters per second, and its position at \(t=1\) is 4 meters. Find its position \(s(t)\).

Solution

Velocity is an antiderivative of acceleration, and position is an antiderivative of velocity (topic 4.2). These functions are polynomials, defined for all \(t\), so each step adds one constant, and each given value fixes one. The velocity is

\[v(t)=3t^2+2t+C\]

At \(t=0\), every term but \(C\) is 0, so \(C=v(0)=-5\). The position is an antiderivative of \(v(t)=3t^2+2t-5\), with a new constant \(D\):

\[s(t)=t^3+t^2-5t+D\]

The position is given at \(t=1\), so substitute 1 for \(t\) in every term:

\[\begin{aligned}s(1)=1+1-5+D&=4\\D&=7\end{aligned}\]

The position is \(s(t)=t^3+t^2-5t+7\) meters.

Example 5

Check an antiderivative

Decide whether each statement is true. (a) \(\displaystyle\int xe^x\,dx=\frac{x^2}{2}e^x+C\) (b) \(\displaystyle\int xe^x\,dx=(x-1)e^x+C\)

Solution

Each statement claims an antiderivative of \(xe^x\) on the interval of all real numbers. An antiderivative is defined by its derivative, so differentiate each right side with the product rule (topic 2.8). The constant \(C\) has derivative 0.

\[\frac{d}{dx}\Big(\frac{x^2}{2}e^x\Big)=xe^x+\frac{x^2}{2}e^x\]

The extra term \(\frac{x^2}{2}e^x\) is not 0 for \(x\neq0\), so statement (a) is false.

\[\begin{aligned}\frac{d}{dx}\big((x-1)e^x\big)&=e^x+(x-1)e^x\\&=xe^x\end{aligned}\]

This is the integrand at every \(x\), so statement (b) is true. No rule on this page finds this antiderivative, but differentiation confirms it.

Each example is one of the five skills of topic 6.8 in Which & Why: AP Calculus.