Here's a simple integral that we can't yet evaluate:
\begin{equation*}
\int x\cos(x) \,dx.
\end{equation*}

It's a simple matter to take the derivative of the integrand using the Product Rule, but there is no Product Rule for integrals. However, this section introduces Integration by Parts, a method of integration that is based on the Product Rule for derivatives. It will enable us to evaluate this integral.

The Product Rule says that if \(u\) and \(v\) are functions of \(x\text{,}\) then \((uv)' = u'v + uv'\text{.}\) For simplicity, we've written \(u\) for \(u(x)\text{,}\) \(u'\) for \(u'(x)\text{,}\) \(v\) for \(v(x)\text{,}\) and \(v'\) for \(v'(x)\text{.}\) Suppose we integrate both sides with respect to \(x\text{.}\) This gives
\begin{equation*}
\int (uv)'\,dx = \int (u'v+uv')\,dx.
\end{equation*}

By the Fundamental Theorem of Calculus, the left side integrates to \(uv\text{.}\) The right side can be broken up into two integrals, and we have
\begin{equation*}
uv = \int u'v\,dx + \int uv'\,dx.
\end{equation*}

Solving for the second integral we have
\begin{equation*}
\int uv'\,dx = uv - \int u'v\,dx.
\end{equation*}

Using differential notation, we can write \(du = u'(x)dx\) and \(dv=v'(x)dx\) and the expression above can be written as follows:
\begin{equation*}
\int u\,dv = uv - \int v\,du.
\end{equation*}

This is the Integration by Parts formula. For reference purposes, we state this in a theorem.

Theorem6.2.1Integration by Parts

Let \(u\) and \(v\) be differentiable functions of \(x\) on an interval \(I\) containing \(a\) and \(b\text{.}\) Then
\begin{equation*}
\int u\ dv = uv - \int v\ du,
\end{equation*}
and
\begin{equation*}
\int_{x=a}^{x=b} u\ dv = uv\Big|_a^b - \int_{x=a}^{x=b}v\ du.
\end{equation*}

The integration by parts formula can also be written as
\begin{equation*}
\int f(x)\ g'(x) \ dx=f(x)g(x)-\int \fp(x)\ g(x)\ dx
\end{equation*}
for differentiable functions \(f\) and \(g\text{.}\)

Let's try an example to understand our new technique.

Example6.2.2Integrating using Integration by Parts

The key to Integration by Parts is to identify part of the integrand as “\(u\)” and part as “\(dv\text{.}\)” Regular practice will help one make good identifications, and later we will introduce some principles that help. For now, let \(u=x\) and \(dv=\cos(x) \ dx\text{.}\)

It is generally useful to make a small table of these values as done below. Right now we only know \(u\) and \(dv\) as shown on the left of Figure 6.2.3; on the right we fill in the rest of what we need. If \(u = x\text{,}\) then \(du = dx\text{.}\) Since \(dv = \cos(x) \ dx\text{,}\) \(v\) is an antiderivative of \(\cos(x)\text{.}\) We choose \(v = \sin(x)\text{.}\)

Now substitute all of this into the Integration by Parts formula, giving
\begin{equation*}
\int x\cos(x) \,dx = x\sin(x) - \int \sin(x) \,dx.
\end{equation*}

We can then integrate \(\sin(x)\) to get \(-\cos(x) + C\) and overall our answer is
\begin{equation*}
\int x\cos(x) \ dx = x\sin(x) + \cos(x) + C.
\end{equation*}

Note how the antiderivative contains a product, \(x\sin(x)\text{.}\) This product is what makes Integration by Parts necessary.

We can check our work by taking the derivative:
\begin{align*}
\lzoo{x}{x\sin(x) + \cos(x) + C} \amp =x\cos(x)+\sin(x)-\sin(x)+0\\
\amp = x\cos(x)\text{.}
\end{align*}

You may wonder what would have happened in Example 6.2.2 if we had chosen our \(u\) and \(dv\) differently. If we had chosen \(u=\cos(x)\) and \(dv=x \ dx\) then \(du=-\sin(x)\ dx\) and \(v=x^2/2\text{.}\) Our second integral is not simpler than the first, we would have \(\int x\cos(x)\,dx=\cos(x)\frac{x^2}{2}-\int \frac{x^2}{2}\left(-\sin(x)\right)\,dx\text{.}\) The only way to approach this second integral would be yet another integration by parts.

Example 6.2.2 demonstrates how Integration by Parts works in general. We try to identify \(u\) and \(dv\) in the integral we are given, and the key is that we usually want to choose \(u\) and \(dv\) so that \(du\) is simpler than \(u\) and \(v\) is hopefully not too much more complicated than \(dv\text{.}\) This will mean that the integral on the right side of the Integration by Parts formula, \(\int v\,du\) will be simpler to integrate than the original integral \(\int u\,dv\text{.}\)

In the example above, we chose \(u=x\) and \(dv=\cos(x) \,dx\text{.}\) Then \(du=dx\) was simpler than \(u\) and \(v=\sin(x)\) is no more complicated than \(dv\text{.}\) Therefore, instead of integrating \(x\cos(x) \,dx\text{,}\) we could integrate \(\sin(x) \,dx\text{,}\) which we knew how to do.

A useful mnemonic for helping to determine \(u\) is “LIATE,” where

L = Logarithmic, I = Inverse Trig., A = Algebraic (polynomials, roots, power functions),T = Trigonometric, and E = Exponential.

If the integrand contains both a logarithmic and an algebraic term, in general letting \(u\) be the logarithmic term works best, as indicated by L coming before A in LIATE.

We now consider another example.

Example6.2.4Integrating using Integration by Parts

The integrand contains an Algebraic term (\(x\)) and an Exponential term (\(e^x\)). Our mnemonic suggests letting \(u\) be the algebraic term, so we choose \(u=x\) and \(dv=e^x\,dx\text{.}\) Then \(du=dx\) and \(v=e^x\) as indicated by the tables below.

We see \(du\) is simpler than \(u\text{,}\) while there is no change in going from \(dv\) to \(v\text{.}\) This is good. The Integration by Parts formula gives
\begin{equation*}
\int x e^x\,dx = xe^x - \int e^x\,dx.
\end{equation*}

The integral on the right is simple; our final answer is
\begin{equation*}
\int xe^x\ dx = xe^x - e^x + C.
\end{equation*}

Note again how the antiderivatives contain a product term.

Example6.2.6Integrating using Integration by Parts

The mnemonic suggests letting \(u=x^2\) instead of the trigonometric function, hence \(dv=\cos(x) \,dx\text{.}\) Then \(du=2x\,dx\) and \(v=\sin(x)\) as shown below.

The Integration by Parts formula gives
\begin{equation*}
\int x^2\cos(x) \,dx = x^2\sin(x) - \int 2x\sin(x) \,dx.
\end{equation*}

At this point, the integral on the right is indeed simpler than the one we started with, but to evaluate it, we need to do Integration by Parts again. Here we choose \(r=2x\) and \(ds=\sin(x)\) and fill in the rest below. (We are choosing new names since we have already used \(u\) and \(v\text{.}\) Our intgration by parts formula is now \(\int r\ ds=rs-\int s\ dr\text{.}\))

The integral all the way on the right is now something we can evaluate. It evaluates to \(-2\sin(x)\text{.}\) Then going through and simplifying, being careful to keep all the signs straight, our answer is
\begin{equation*}
\int x^2\cos(x) \ dx = x^2\sin(x) + 2x\cos(x) - 2\sin(x) + C.
\end{equation*}

Example6.2.9Integrating using Integration by Parts

This is a classic problem. Our mnemonic suggests letting \(u\) be the trigonometric function instead of the exponential. In this particular example, one can let \(u\) be either \(\cos(x)\) or \(e^x\text{;}\) to demonstrate that we do not have to follow LIATE, we choose \(u=e^x\) and hence \(dv = \cos(x) \,dx\text{.}\) Then \(du=e^x\,dx\) and \(v=\sin(x)\) as shown below.

Notice that \(du\) is no simpler than \(u\text{,}\) going against our general rule (but bear with us). The Integration by Parts formula yields
\begin{equation*}
\int e^x\cos(x) \ dx = e^x\sin(x) - \int e^x\sin(x) \,dx.
\end{equation*}

The integral on the right is not much different than the one we started with, so it seems like we have gotten nowhere. Let's keep working and apply Integration by Parts to the new integral, using \(u=e^x\) and \(dv = \sin(x) \,dx\text{.}\) This leads us to the following:

One may have noticed that we have rules for integrating the familiar trigonometric functions and \(e^x\text{,}\) but we have not yet given a rule for integrating \(\ln(x)\text{.}\) That is because \(\ln(x)\) can't easily be integrated with any of the rules we have learned up to this point. But we can find its antiderivative by a clever application of Integration by Parts. Set \(u=\ln(x)\) and \(dv=dx\text{.}\) This is a good, sneaky trick to learn as it can help in other situations. This determines \(du=(1/x)\,dx\) and \(v=x\) as shown below.

Putting this all together in the Integration by Parts formula, things work out very nicely:
\begin{equation*}
\int \ln(x) \,dx = x\ln(x) - \int x\,\frac1x\,dx.
\end{equation*}

The new integral simplifies to \(\int 1\,dx\text{,}\) which is about as simple as things get. Its integral is \(x+C\) and our answer is
\begin{equation*}
\int \ln(x) \ dx = x\ln(x) - x + C.
\end{equation*}

Example6.2.14Integrating using Int. by Parts: antiderivative of \(\arctan x\)

Evaluate \(\displaystyle \int \arctan x \,dx\text{.}\)

The same sneaky trick we used above works here. Let \(u=\arctan x\) and \(dv=dx\text{.}\) Then \(du=1/(1+x^2)\,dx\) and \(v=x\text{.}\) The Integration by Parts formula gives
\begin{equation*}
\int \arctan x \,dx = x\arctan x - \int \frac x{1+x^2}\,dx.
\end{equation*}

The integral on the right can be solved by substitution. Taking \(w=1+x^2\text{,}\) we get \(dw=2x\,dx\text{.}\) The integral then becomes
\begin{equation*}
\int \arctan x \,dx = x\arctan x - \frac12\int \frac 1{w}\,dw.
\end{equation*}

The integral on the right evaluates to \(\ln\abs{w}+C\text{,}\) which becomes \(\ln(1+x^2)+C\text{.}\) Therefore, the answer is
\begin{equation*}
\int \arctan x\ dx = x\arctan x - \ln(1+x^2) + C.
\end{equation*}

Subsection6.2.1Substitution Before Integration

When taking derivatives, it was common to employ multiple rules (such as using both the Quotient and the Chain Rules). It should then come as no surprise that some integrals are best evaluated by combining integration techniques. In particular, here we illustrate making an “unusual” substitution first before using Integration by Parts.

Example6.2.15Integration by Parts after substitution

The integrand contains a composition of functions, leading us to think Substitution would be beneficial. Letting \(u=\ln(x)\text{,}\) we have \(du = 1/x\ dx\text{.}\) This seems problematic, as we do not have a \(1/x\) in the integrand. But consider:
\begin{equation*}
du = \frac 1x\ dx \Rightarrow x\cdot du = dx.
\end{equation*}

Since \(u = \ln(x)\text{,}\) we can use inverse functions and conclude that \(e^{\ln(x)} = e^u\Rightarrow x=e^u\text{.}\) Therefore we have that
\begin{align*}
dx \amp = x\cdot du\\
\amp = e^u\ du.
\end{align*}

We can thus replace \(\ln(x)\) with \(u\) and \(dx\) with \(e^u\ du\text{.}\) Thus we rewrite our integral as
\begin{equation*}
\int \cos(\ln(x) )\ dx = \int e^u\cos(u) \ du.
\end{equation*}

We evaluated this integral on the right in Example 6.2.9. (This integral can also be found in a table of integrals). Using the result there, we have:
\begin{align*}
\int \cos(\ln(x) )\ dx \amp = \int e^u\cos(u) \ du\\
\amp = \frac12e^u\big(\sin(u) + \cos(u) \big) + C\\
\amp = \frac12e^{\ln(x) } \big(\sin(\ln(x) ) + \cos(\ln(x) )\big)+C\\
\amp = \frac12x \big(\sin(\ln(x) ) + \cos(\ln(x) )\big)+C.
\end{align*}

Subsection6.2.2Definite Integrals and Integration By Parts

So far we have focused only on evaluating indefinite integrals. Of course, we can use Integration by Parts to evaluate definite integrals as well, as Theorem 6.2.1 states. We do so in the next example.

Example6.2.16Definite integration using Integration by Parts

In general, Integration by Parts is useful for integrating certain products of functions, like \(\int x e^x\,dx\) or \(\int x^3\sin(x) \,dx\text{.}\) It is also useful for integrals involving logarithms and inverse trigonometric functions.

As stated before, integration is generally more difficult than derivation. We are developing tools for handling a large array of integrals, and experience will tell us when one tool is preferable/necessary over another. For instance, consider the three similar–looking integrals
\begin{equation*}
\int xe^x\,dx, \qquad \int x e^{x^2}\,dx \qquad \text{ and } \qquad \int xe^{x^3}\,dx.
\end{equation*}

While the first is calculated easily with Integration by Parts, the second is best approached with Substitution. Taking things one step further, the third integral has no answer in terms of elementary functions, so none of the methods we learn in calculus will get us the exact answer.

Integration by Parts is a very useful method, second only to substitution. In the following sections of this chapter, we continue to learn other integration techniques. Section 6.3 focuses on handling integrals containing trigonometric functions.