Reversed product rule
"Integration by parts" is another important integration technique. It is essentially the product rule running in reverse. In this lecture, we will learn how it works and why it works.
"Integration by parts" is another important integration technique. It is essentially the product rule running in reverse, and it allows us to turn one integral into a potentially easier integral. In this lecture, we will learn how it works and why it works. We will also look at some advanced applications.
For example, this technique would allow us to compute integrals like \[ \int x e^x dx \quad\quad \int \ln(x) dx \quad\quad \int x^2 \cos(x) dx \ldots \]
Review. Suppose $u$ and $v$ are both differentiable functions of $x$, then the product rule tells us that \[ \frac{d}{dx} (uv) = \frac{du}{dx} v + u \frac{dv}{dx}. \] From this, we can easily derive the corresponding integral version.
Integrating both sides produces \[ uv = \int v \, du + \int u \, dv. \]
Rearranging the terms, we get \[ \int u \, dv = uv - \int v \, du, \] and this is the basis of this "integration by parts" technique.
The idea is that, if we can express an integral as $\int u \, dv$ for some choices of $u$ and $v$, then we can turn that integral into $uv - \int v \, du$ with the hope that we make the "right" choices so that the resulting integral is easier to deal with.
We will use $\int u \, dv = uv - \int v \, du.$
Solution. First, note that this integral cannot be computed with substitution. To apply integration by parts, we want to choose $u$ and $dv$ so that $\int x e^{3x} dx = \int u \, dv$, yet the integral $\int v \, du$ it produced is simpler.
Choosing the "right" $u,v$ takes some practice, and we will discuss the strategies soon. For now, let's start with a choice and see how to apply it.
Let $\color{red}{u = x}$, and $\color{blue}{dv = e^{x} dx}$, then $\color{red}{du = dx}$, and $\color{blue}{v = \int e^{x} dx = e^{x}}$.
Notice that there is no need to include the "$+C$" term in $v$, as it will be hiding inside the integral we are going to produce, and we don’t have to worry about it until the last step.
Applying integration by parts, the original integral becomes \[ \int u \, dv = uv - \int v \, du = x e^{x} - \int e^{x} dx = x e^{x} - e^{x} + C. \]
Again, we use $\int u \, dv = uv - \int v \, du.$
Solution. This integral also cannot be computed with substitution. To apply integration by parts, we want to choose $u$ and $dv$ so that $\int \frac{\ln x}{x^2} dx = \int u \, dv$, yet the integral $\int v \, du$ it produced is simpler. Again, start with a choice and only focus on how to apply this technique.
Let $\color{red}{u = \ln x}$, and $\color{blue}{dv = \frac{1}{x^2} dx}$, then $\color{red}{du = \frac{1}{x} \, dx}$, and $\color{blue}{v = \int \frac{1}{x^2} dx = - \frac{1}{x}}$.
A premise to our success in applying integration by parts is picking the "right" $u$ and $dv$.
Notice that the roles of $u$ and $dv$ are different. Indeed, in the very next step, we will compute \begin{align*} u &\mapsto du & dv &\mapsto v & &\text{and produce} \quad uv - \int v \, du. \end{align*}
Let us revisit our very first example \[\int x e^x dx.\]
We have two choices:
\begin{align*} &\text{With} & u=x,\; dv = e^x dx &\longrightarrow \int v du = \color{blue}{ \int e^x dx } \\ &\text{whereas} & u = e^x,\; dv = xdx &\longrightarrow \int v du = \color{red}{ \int \frac{x^2}{2} \, e^x \, dx }. \end{align*}
Clearly, the first choice is preferable. Indeed, the second choice leads to even more complicated integrals. This is why we chose $u = x$ and $dv = e^x \, dx$ and not the other way around.
Solution. We only have two choices:
For choice (1), we $u=1$, then $du = 0 dx$. But $v = \int dv = \int \ln x \, dx$, which is exactly what we are asked to compute in the first place. So clearly this is leading to nowhere.
For choice (2), \begin{align*} &\text{Let } & \color{red}{u} &= \color{red}{\ln(x)} &&\text{and} & \color{blue}{dv} &= \color{blue}{dx} \\ &\text{then} & \color{red}{du} &= \color{red}{\frac{1}{x} dx} &&\text{and} & \color{blue}{v} &= \color{blue}{x}. \end{align*}
Therefore \[ \int \color{red}{ \ln x} \, \color{blue}{ dx} = \int \color{red}{ u} \color{blue}{ dv} = \color{red}{u}\color{blue}{v} - \int \color{blue}{v} \color{red}{du} = \color{red}{\ln(x)} \color{blue}{ x} - \int \frac{\color{blue}{x}}{\color{red}{x}} \color{red}{dx} = x \ln x - x + C. \]
The technique of integration by parts can be combined with other techniques or be applied recursively.
Solution. We apply integration by parts
\begin{align*} \text{Let } u &= x^2, & dv &= \cos x \, dx \\ \text{then } du &= 2x \, dx & v &= \sin x \end{align*}
The resulting integral also requires integration by parts:
Then the original integral is turned into \[ x^2 \sin x - 2 \left( - x \cos x - \int - \cos(x) dx \right) = x^2 \sin x + 2 x \cos x - 2 \sin x + C \]
Integration by parts may produce integrals that are identical or proportional to the original integral. When this happens, it appears we are running around in circles and won't be able to compute the integral.
However, very often, we can still compute the integral by collecting all the terms involving the target integral in the resulting equation. We will see how this idea could work in the following example.
Solution. We apply integration by parts.
\begin{align*} \text{Let}\quad u &= \cos(\theta), & dv &= e^{\theta} d\theta. \\ \text{Then}\; du &= -\sin(\theta) d\theta, & v &= e^{\theta}. \end{align*}
\[ \int e^\theta \cos(\theta) d\theta = \int u dv = uv - \int v \, du = \cos(\theta) e^{\theta} + \int e^\theta \sin(\theta) d\theta. \]
Applying integration by parts again with $u = \sin(\theta)$ and $dv = e^\theta d\theta$, we get \[ \cos(\theta) e^{\theta} + \int e^\theta \sin(\theta) d\theta = \cos(\theta) e^{\theta} + \left( \sin(\theta) e^\theta - \color{red}{\int e^\theta \cos(\theta) d\theta} \right). \]
The highlighted part is the original integral. To find a way out, notice that \[ \color{red}{\int e^\theta \cos(\theta) d\theta} = \cos(\theta) e^{\theta} + \sin(\theta) e^\theta - \color{red}{\int e^\theta \cos(\theta) d\theta}. \]
By moving the highlighted term to the left hand side, we can see that \[ \color{red}{\int e^\theta \cos(\theta) d\theta} = \frac{ \cos(\theta) e^{\theta} + \sin(\theta) e^\theta }{2} + C. \]