Skip to main content

Math 220-2: Kursobjekt

Section 1.18 Integration by parts

The integration by parts technique is yet another instance of our Dictum 1.5.3. In this case we take the familiar product rule of differentiation
\begin{equation} (fg)' =f'g+fg'\text{,}\tag{1.18.1} \end{equation}
reexpress it algebraically as
\begin{align} f'g \amp = (fg)'-fg'\text{,}\tag{1.18.2} \end{align}
and then integrate both sides to conclude
\begin{align} \int f(x)g'(x)\, dx \amp = \int (f(x)g(x))'\, dx- \int f'(x)g(x)\, dx\tag{1.18.3}\\ \amp = f(x)g(x)-\int f(x)g'(x)\, dx\text{.}\tag{1.18.4} \end{align}
We have just given a proof of what is called the integration by parts rule.

Example 1.18.3. Classic by parts.

Compute \(\displaystyle\int_0^1 xe^{-x}\, dx\)
Solution.
\begin{align*} \int_0^1 xe^{-x}\, dx\amp = -xe^{-x}\Bigr\vert_0^1+\int_0^1 e^{-x}\, dx \amp (u=x, v'=e^{-x}) \\ \amp = -\frac{1}{e}-e^{-x}\Bigr\vert_0^1\\ \amp = 1-\frac{2}{e}\text{.} \end{align*}
The following integrals can all be computed using by parts. However, for some of these byou might also explore whether substitution could serve as a useful technique.

Example 1.18.5. Iterated by parts.

\(\displaystyle \int x^2 e^x\, dx\)
Solution.
\begin{align*} \int x^2 e^x\, dx \amp = x^2e^{x}-2\int xe^{x}\, dx \amp (u=x^2, v'=e^x) \\ \amp = x^2e^x-2(xe^x-\int e^{x}) \amp (u=x, v'=e^x)\\ \amp = x^2e^x-2xe^x+2e^x+C\text{.} \end{align*}

Example 1.18.6. Surprising by parts.

Compute \(\displaystyle\int \ln \vert x\vert\, dx\)
Solution.
We have \(\ln x=\ln \abs{x}\cdot 1\text{.}\) LIPET suggests trying \(u=\ln \abs{x}\text{,}\) \(v'=1\text{:}\)
\begin{align*} \int \ln \vert x\vert\, dx \amp = x\ln\abs{x}-\int \cancel{x}\cdot \frac{1}{\cancel{x}}\, dx \amp (u=\ln \abs{x}, v'=1)\\ \amp = x\ln\abs{x}-\int 1\, dx\\ \amp = x\ln\abs{x}-x+C\text{.} \end{align*}

Example 1.18.7. Rational function.

Compute \(\displaystyle\int \frac{x^3}{x^2+1}\, dx\)
Solution.
Using by parts with \(u=x^2\) and \(v'=\frac{x}{x^2+1}\text{,}\) we have
\begin{align*} \int \frac{x^3}{x^2+1}\, dx\amp= \frac{1}{2}x^2\ln \abs{x^2+1}-\int x\ln\abs{x^2+1}\, dx \\ \amp = \frac{1}{2}x^2\ln\abs{x^2+1}-\frac{1}{2}\int \ln \abs{u}\, du \amp (u=x^2+1, du=2xdx)\\ \amp = \frac{1}{2}x^2\ln\abs{x^2+1}-\frac{1}{2}(u\ln\abs{u}-u)+C \amp (\knowl{./knowl/xref/eg_by_parts_4.html}{\text{Example 1.18.6}})\\ \amp = \frac{1}{2}x^2\ln\abs{x^2+1}-\frac{1}{2}(x^2+1)\ln\abs{x^2+1}+\frac{1}{2}(x^2+1)+C \\ \amp = \frac{1}{2}(x^2+1)-\ln\abs{x^2+1}+C\text{.} \end{align*}
Alternatively, using the substitution \(u=x^2+1\text{,}\) we have
\begin{align*} \int \frac{1}{2}\frac{x^3}{x^2+1}\, dx \amp = \frac{1}{2}\int \frac{u-1}{u}\, du \amp (u=x^2+1, du=2xdx) \\ \amp = \frac{1}{2}\int 1-\frac{1}{u}\, du \\ \amp = \frac{1}{2}(x^2+1)-\ln\abs{x^2+1}+C\text{.} \end{align*}
As a third alternative, we could use polynomial division to write \(\frac{x^3}{x^2+1}=x-\frac{x}{x^2+1}\text{,}\) and then conclude
\begin{equation*} \int \frac{x^3}{x^2+1}\, dx=\int x-\frac{x}{x^2+1}\, dx=\frac{1}{2}x^2-\ln\abs{x^2+1}+C\text{.} \end{equation*}
Note that the answer here differs from the previous two by the constant \(\frac{1}{2}\text{,}\) which of course is not a problem.

Example 1.18.8. Inverse trig.

Compute \(\displaystyle\int \arctan x\, dx\)
Solution.
If using by parts, LIPET suggests the choice \(u=\artcan x\text{,}\) \(v'=1\text{:}\)
\begin{align*} \int \arctan x\, dx \amp = x\arctan x-\int \frac{x}{x^2+1}\, dx \\ \amp = x\arctan x-\frac{1}{2}\ln\abs{x^2+1}+C\text{.} \end{align*}

Example 1.18.9. By parts and algebra.

Compute \(\int e^x\cos x\, dx\)
Solution.
Here is an example where it looks like we are in danger of entering an infinite regress, but where a minus sign comes to our rescue. We have
\begin{align*} \int e^x\cos x\, dx\amp = e^x\sin x-\int e^x\sin x \amp (u=e^x, v'=\cos x) \\ \amp = e^x\sin x-(-e^x\cos x+\int e^x\cos x\, dx) \amp (u=e^x,v'=\sin x)\\ \amp = e^x\sin x+e^x\cos x-\int e^x\cos x\, dx\text{.} \end{align*}
We’ve shown that
\begin{equation*} \int e^x\cos x\, dx=e^x\sin x+e^x\cos x-\int e^x\cos x\, dx\text{.} \end{equation*}
Using algebra, it follows that
\begin{equation*} 2\int e^x\cos x=e^x\sin x+e^x\cos x+C\text{,} \end{equation*}
or
\begin{equation*} \int e^x\cos x\, dx=\frac{1}{2}(e^x\sin x+e^x\cos x)+D\text{.} \end{equation*}