(I5) Integration By Parts (Indefinite)#

By the end of the lesson you will be able to:

  • calculate an indefinite integral using integration by parts.

Lecture Videos#

The Product Rule#

We’re going to start by first recalling one of our derivative rules, the product rule.

\[ \dfrac{d}{dx}\big[f(x)\cdot g(x)\big] = \big[f(x)\big]' \cdot g(x) + f(x)\cdot \big[g(x)\big]' \]

If we integrate both sides of this equation we get:

\[ f(x)\cdot g(x)= \int \big[f(x)\big]' \cdot g(x)\; dx + \int f(x)\cdot \big[g(x)\big]' \; dx \]

And then finally we rearrange the terms to get our integration by parts formula:

\[ \int f(x)\cdot \big[g(x)\big]' \; dx = f(x)\cdot g(x) - \int g(x)\cdot \big[f(x)\big]'\; dx \]

The Formula#

Integration By Parts

\[\int u \; dv = uv -\int v \; du\]

How It Works#

We tend to think of integration by parts as a process:

  1. Choose \(u\) and \(dv\).

  2. Calculate \(du\) and \(v\).

  3. Plug all of these pieces into the formula.

  4. Finish integrating.

Example 1#

Integrate the following:

\[ \int x \cdot e^x \, dx \]

Click through the steps to see what we do.

If you want, give it a try first! (Use the steps listed above as a guide to get you started.)

Our first step is choose \(u\) and \(dv\):

Our choice for \(u\)
\[u=x\]
Our choice for \(dv\)
\[dv = e^x \; dx\]

Next, we calculate \(du\) and \(v\) by differentiating and integrating respectively:

Differentiate
\[\begin{split}u &=x \\ du &= 1\cdot dx\end{split}\]
Integrate
\[\begin{split}dv &=e^x \; dx \\ v &=e^x\end{split}\]

Now we take the pieces we just calculated and plug them into the integration by parts formula.

The Formula
\[\int u \; dv = uv -\int v \; du\]

Our Pieces

\[\begin{split}u &=x \\ du &= 1\cdot dx\end{split}\]
\[\begin{split}dv &=e^x \; dx \\ v &=e^x\end{split}\]

Doing this we get:

\[\int x \cdot e^x\; dx = x\cdot e^x -\int e^x \; dx\]

And finally we finish calculating any remaining integrals:

\[\begin{split}\int x \cdot e^x\; dx & = x\cdot e^x -\int e^x \; dx \\ & = x\cdot e^x - e^x +C\end{split}\]

(Don’t forget \(+C\) for indefinite integrals!)

How to Choose?#

So the question is, how do we choose \(u\) and \(dv\)? Well, just like with substitution rule, there are a few strategies we can keep in mind, but it does come down to practice and a little trial-and-error.

Note

In both strategies listed below we first need to break the function into two pieces or parts.

Meta-Strategy

We look at the two parts of our function and choose \(u\) and \(dv\) such that the:

  • \(u\) term simplifies when differentiated

  • \(dv\) term is easily integrated

L I A T E - Strategy

A more specific strategy is to remember the acronym LIATE

  • L - logarithmic functions

  • I - inverse trigonometric functions

  • A - algebraic functions

  • T - trigonometric functions

  • E - exponential functions.

We classify each part of our function based on these 5 categories.

  • Choose \(u\) to be the part higher on this list

  • Choose \(dv\) to be the part lower on this list


Example 2#

Integrate the following:

\[ \int (2x+5) \cdot \sin(3x) \, dx \]
Question: What do you think we should pick for \(u\) and \(dv\) in this example?

Answer: Maybe give \(u=2x+5\) and \(dv= \sin(3x) \cdot dx\) a try?

Click through the steps to see what we do.

If you want, give it a try first! (Use the steps listed above as a guide to get you started.)

Our first step is to choose \(u\) and \(dv\). To help with this decision we classify the two parts of our function.

A for Algebraic
\[2x+5\]
T for Trigonometric
\[\sin(3x) \]

Since we have an algebraic part and a trigonometric part, the algebraic part is our choice for \(u\) and the trigonometric part is our choice for \(dv\).

Our choice for \(u\)
\[u=2x+5\]
Our choice for \(dv\)
\[dv = \sin(3x) \; dx\]

Next, we calculate \(du\) and \(v\) by differentiating and integrating respectively:

Differentiate
\[\begin{split}u &=2x+5 \\ du &= 2\cdot dx\end{split}\]
Integrate
\[\begin{split}dv &=\sin(3x) \; dx \\ v &=-\tfrac{1}{3}\cos(3x)\end{split}\]

Now we take the pieces we just calculated and plug them into the integration by parts formula.

The Formula
\[\int u \; dv = uv -\int v \; du\]

Our Pieces

\[\begin{split}u &=2x+5 \\ du &= 2\cdot dx\end{split}\]
\[\begin{split}dv &=\sin(3x) \; dx \\ v &=-\tfrac{1}{3}\cos(3x)\end{split}\]

Doing this we get:

\[\begin{split}\int (2x+5) \cdot \sin(3x) & \, dx = uv -\int v \; du \\ & = (2x+5)\cdot \left(-\tfrac{1}{3}\cos(3x) \right) -\int \left(-\tfrac{1}{3}\cos(3x) \right) \cdot 2 \; dx\end{split}\]

And finally we finish calculating any remaining integrals:

\[\begin{split}&= -\tfrac{1}{3}(2x+5)\cdot \cos(3x) + \tfrac{2}{3}\int \cos(3x) \; dx \\ & = -\tfrac{1}{3}(2x+5)\cdot \cos(3x) + \tfrac{2}{3}\left( \tfrac{1}{3}\sin(3x)\right)+C\end{split}\]

(Don’t forget \(+C\) for indefinite integrals!)

K-form Integrals#

Below are a few helpful integral formulas that we will need to use pretty frequently. (You can prove each of these using substitution rule with \(u=kx\)).

K-form Integrals

\[\begin{split}&\int e^{kx}\, dx = \tfrac{1}{k}e^{kx}+C\\ &\int \sin(kx)\, dx = -\tfrac{1}{k}\cos(kx)+C\\ &\int \cos(kx)\, dx = \tfrac{1}{k}\sin(kx)+C\end{split}\]

Example 3#

Integrate the following:

\[ \int x^2 \cdot \ln(2x) \, dx \]
Question: What do you think we should pick for \(u\) and \(dv\) in this example?

Answer: Maybe give \(u=\ln(2x)\) and \(dv= x^3 \cdot dx\) a try?

Click through the steps to see what we do.

If you want, give it a try first! (Use the steps listed above as a guide to get you started.)

Our first step is to choose \(u\) and \(dv\). To help with this decision we classify the two parts of our function.

A for Algebraic
\[x^2\]
L for Logarithmic
\[\ln(2x) \]

Since we have an algebraic part and a logarithmic part, the algebraic part is our choice for \(dv\) and the logarithmic part is our choice for \(u\).

Our choice for \(u\)
\[u=\ln(2x) \]
Our choice for \(dv\)
\[dv = x^2 \; dx\]

Next, we calculate \(du\) and \(v\) by differentiating and integrating respectively:

Differentiate
\[\begin{split}u &=\ln(2x) \\ du &= \dfrac{1}{2x}\cdot \big[2x\big]'\cdot dx\end{split}\]
Integrate
\[\begin{split}dv &=x^2 \; dx \\ v &=\tfrac{1}{3}x^3\end{split}\]

Now we take the pieces we just calculated and plug them into the integration by parts formula.

The Formula
\[\int u \; dv = uv -\int v \; du\]

Our Pieces

\[\begin{split}u &=\ln(2x) \\ du &= \dfrac{1}{x}\cdot dx\end{split}\]
\[\begin{split}dv &=x^2 \; dx \\ v &=\tfrac{1}{3}x^3\end{split}\]

Doing this we get:

\[\begin{split}\int x^2 \cdot \ln(2x) \,& dx = uv -\int v \; du \\ &= \ln(2x)\cdot \left(\tfrac{1}{3}x^3 \right) -\int \left(\tfrac{1}{3}x^3 \right) \cdot \dfrac{1}{x} \; dx\end{split}\]

And finally we finish calculating any remaining integrals. Notice that we need to multiply the \(x^3\) and \(1/x\) together, before we can actually do that integral.

\[\begin{split}&= \ln(2x)\cdot \left(\tfrac{1}{3}x^3 \right) -\int \left(\tfrac{1}{3}x^3 \right) \cdot \dfrac{1}{x} \; dx \\ &= \tfrac{1}{3}x^3\cdot \ln(2x) -\int \tfrac{1}{3}x^2 \; dx\\ &= \tfrac{1}{3}x^3\cdot \ln(2x) - \tfrac{1}{9}x^3 +C\end{split}\]

(Don’t forget \(+C\) for indefinite integrals!)

Example 4 (Inverse)#

Note

In this example we see the general strategy for integrating inverse functions.

Integrate the following:

\[ \int \ln x \, dx \]
Question: What do you think we should pick for \(u\) and \(dv\) in this example?

Answer: Maybe we could do: \(u=\ln x\) and \(dv= 1\cdot dx\)?

Click through the steps to see what we do.

If you want, give it a try first! (Use the steps listed above as a guide to get you started.)

Looking at this function we see that:

  • its not one of our elementary forms and

  • its not a composite function (so substitution rule most likely doesn’t apply)

What can we do? A little bit of a trick: write the function as a product.

\[ \left(\ln x\right)\cdot 1 \]

So that we have the integral:

\[ \int \left(\ln x\right)\cdot 1 \cdot \, dx \]

Our first step is to choose \(u\) and \(dv\). To help with this decision we classify the two parts of our function.

A for Algebraic
\[1\]
L for Logarithmic
\[\ln x \]

Since we have an algebraic part and a logarithmic part, the algebraic part is our choice for \(dv\) and the logarithmic part is our choice for \(u\).

Our choice for \(u\)
\[u=\ln x \]
Our choice for \(dv\)
\[dv = 1\cdot dx\]

Next, we calculate \(du\) and \(v\) by differentiating and integrating respectively:

Differentiate
\[\begin{split}u &=\ln x \\ du &= \dfrac{1}{x}\cdot dx\end{split}\]
Integrate
\[\begin{split}dv &=1 \cdot dx \\ v &=x\end{split}\]

Now we take the pieces we just calculated and plug them into the integration by parts formula.

The Formula
\[\int u \; dv = uv -\int v \; du\]

Our Pieces

\[\begin{split}u &=\ln x \\ du &= \dfrac{1}{x}\cdot dx\end{split}\]
\[\begin{split}dv &=1 \cdot dx \\ v &=x\end{split}\]

Doing this we get:

\[\begin{split}\int \ln x \,& dx = uv -\int v \; du \\ &= \left(\ln x\right)\cdot x -\int x\cdot \dfrac{1}{x} \; dx\end{split}\]

And finally we finish calculating any remaining integrals. Notice that we need to multiply the \(x\) and \(1/x\) together, before we can actually do that remaining integral.

\[\begin{split}&= \left(\ln x\right)\cdot x -\int x\cdot \dfrac{1}{x} \; dx\\ &= x\ln x -\int 1 \; dx\\ &= x\ln x -x +C\end{split}\]

(Don’t forget \(+C\) for indefinite integrals!)

Example 5 (Twice)#

Note

In this example we see that when solving an integral, sometimes, we need to use integration-by-parts more than once.

Integrate the following:

\[ \int x^2 e^{-2x} \, dx \]
Question: What do you think we should pick for \(u\) and \(dv\) in this example?

Answer: Let’s do \(u=x^2\) and \(dv= e^{-2x} \cdot dx\).

First Time#

Click through the steps to see what we do.

If you want, give it a try first! (Use the steps listed above as a guide to get you started.)

Our first step is to choose \(u\) and \(dv\). To help with this decision we classify the two parts of our function.

A for Algebraic
\[x^2\]
E for Exponential
\[e^{-2x}\]

Since we have an algebraic part and an exponential part, the algebraic part is our choice for \(u\) and the exponential part is our choice for \(dv\).

Our choice for \(u\)
\[u= x^2\]
Our choice for \(dv\)
\[dv = e^{-2x} \; dx\]

Next, we calculate \(du\) and \(v\) by differentiating and integrating respectively:

Differentiate
\[\begin{split}u &=x^2 \\ du &= 2x\cdot dx\end{split}\]
Integrate
\[\begin{split}dv &= e^{-2x} \; dx \\ v &=-\tfrac{1}{2}e^{-2x}\end{split}\]

Now we take the pieces we just calculated and plug them into the integration by parts formula.

The Formula
\[\int u \; dv = uv -\int v \; du\]

Our Pieces

\[\begin{split}u &=x^2 \\ du &= 2x\cdot dx\end{split}\]
\[\begin{split}dv &= e^{-2x} \; dx \\ v &=-\tfrac{1}{2}e^{-2x}\end{split}\]

Doing this we get:

\[\begin{split}\int x^2 \cdot e^{-2x} & \, dx = uv -\int v \; du \\ & = x^2\cdot \left(-\tfrac{1}{2}e^{-2x}\right) -\int \left(-\tfrac{1}{2}e^{-2x} \right) \cdot 2x \; dx\end{split}\]

And finally we finish calculating any remaining integrals:

\[\begin{split}& = x^2\cdot \left(-\tfrac{1}{2}e^{-2x}\right) -\int \left(-\tfrac{1}{2}e^{-2x} \right) \cdot 2x \; dx \\ &= -\tfrac{1}{2}x^2e^{-2x} + \int x \cdot e^{-2x} \; dx\end{split}\]

But at this point we might realize the resulting integral is still a product of an algebraic part and an exponential part … so we need to use integration by parts again!

Second Time#

So now it becomes a problem of integrating:

\[\int x \cdot e^{-2x} \; dx\]

Our first step is to choose \(u\) and \(dv\). To help with this decision we classify the two parts of our function.

A for Algebraic
\[x\]
E for Exponential
\[e^{-2x}\]

Since we have an algebraic part and an exponential part, the algebraic part is our choice for \(u\) and the exponential part is our choice for \(dv\). You may notice that this integral is similar to the one we started with, and so our choice for \(u\) and \(dv\) here are similar to what we used the first time.

Our choice for \(u\)
\[u= x\]
Our choice for \(dv\)
\[dv = e^{-2x} \; dx\]

Next, we calculate \(du\) and \(v\) by differentiating and integrating respectively:

Differentiate
\[\begin{split}u &=x \\ du &= dx\end{split}\]
Integrate
\[\begin{split}dv &= e^{-2x} \; dx \\ v &=-\tfrac{1}{2}e^{-2x}\end{split}\]

Now we take the pieces we just calculated and plug them into the integration by parts formula.

The Formula
\[\int u \; dv = uv -\int v \; du\]

Our Pieces

\[\begin{split}u &=x \\ du &= dx\end{split}\]
\[\begin{split}dv &= e^{-2x} \; dx \\ v &=-\tfrac{1}{2}e^{-2x}\end{split}\]

Doing this we get:

\[\begin{split}\int x \cdot e^{-2x} & \, dx = uv -\int v \; du \\ & = x\cdot \left(-\tfrac{1}{2}e^{-2x}\right) -\int \left(-\tfrac{1}{2}e^{-2x} \right) \; dx\end{split}\]

And finally we finish calculating any remaining integrals:

\[\begin{split}& = x\cdot \left(-\tfrac{1}{2}e^{-2x}\right) -\int \left(-\tfrac{1}{2}e^{-2x} \right) \; dx\\ &= -\tfrac{1}{2}xe^{-2x} + \tfrac{1}{2} \int e^{-2x} \; dx \\ &= -\tfrac{1}{2}xe^{-2x} + \tfrac{1}{2} \left(\tfrac{-1}{2} e^{-2x}\right) +C\end{split}\]

But we’re not done yet …

All Together#

First Time

From our first integration by parts we found:

\[\int x^2 e^{-2x} \, dx =-\tfrac{1}{2}x^2e^{-2x} + \int x \cdot e^{-2x} \; dx\]
Second Time

From our second integration by parts we found:

\[\int x \cdot e^{-2x} \; dx = -\tfrac{1}{2}xe^{-2x} - \tfrac{1}{4} e^{-2x} +C\]

So putting this all together we get:

\[\int x^2 e^{-2x} \, dx =-\tfrac{1}{2}x^2e^{-2x} -\tfrac{1}{2}xe^{-2x} - \tfrac{1}{4} e^{-2x} +C\]

And if we wanted to, we could simplify by factoring out \(-\tfrac{1}{2} e^{-2x}\) on the right:

\[-\tfrac{1}{2}e^{-2x}(x^2+x+\tfrac{1}{2})+C\]

Example 6#

Integrate the following:

\[ \int e^x \sin (5x) \, dx \]
Question: What do you think we should pick for \(u\) and \(dv\) in this example?

Answer: Let’s do \(u=\sin (5x)\) and \(dv= e^{x} \cdot dx\).

Click through the steps to see what we do.

If you want, give it a try first! (Use the steps listed above as a guide to get you started.)

Using our LIATE strategy, we choose \(u\) to be the trigonometric part of our function and \(dv\) to be the exponential part. Then to get all of our ingredients, we calculate \(du\) and \(v\) by differentiating and integrating respectively.

Our Pieces

\[\begin{split}u &=\sin(5x) \\ du &= 5\cos(5x)\cdot dx \end{split}\]
\[\begin{split}dv &= e^x \; dx \\ v &=e^x\end{split}\]

Applying the integration by parts formula we get:

\[\int e^x \sin (5x) \, dx = e^x\sin(5x)-\int e^x\cdot 5 \cos(5x) \, dx\]

After this, it doesn’t feel like we got anywhere, other than converting our integral with a sine term into an integral with a cosine term. Not to fear! There is a trick and its to do integration by parts again.

We now need to integrate:

\[\int e^x\cdot 5 \cos(5x) \, dx\]

Using our LIATE strategy again we choose \(u\) to be the trigonometric part and \(dv\) to be the exponential part. Be consistent! Then calculate \(du\) and \(v\) just like before.

Our Pieces

\[\begin{split}u &=5\cos(5x) \\ du &= -25\sin(5x)\cdot dx \end{split}\]
\[\begin{split}dv &= e^x \; dx \\ v &=e^x\end{split}\]

Applying the integration by parts formula again we get:

\[\int e^x\cdot 5 \cos(5x) \, dx = 5e^x\cos(5x)+25\int e^x\sin(5x) \, dx\]

Let’s recap where we are. We have the unknown integral we’re trying to figure out:

Unknown Integral
\[\int e^x \sin (5x) \, dx \]

After going through integration by parts twice, we have the following equation and we notice that our unknown integral appears on both sides:

\[\int e^x \sin (5x) \, dx = e^x\sin(5x)-5e^x\cos(5x)-25\int e^x\sin(5x) \, dx\]

To help picture this, let’s replace our unknown integral by \(Y\):

\[Y = e^x\sin(5x)-5e^x\cos(5x)-25Y\]

How would we solve this for \(Y\)? Well, we would add \(25Y\) to both sides to get:

\[26Y = e^x\sin(5x)-5e^x\cos(5x)\]

And then divide both sides by \(26\) to get:

\[Y = \tfrac{1}{26}e^x\sin(5x)-\tfrac{5}{26}e^x\cos(5x)\]

And there we go! We have our unknown antiderivative:

\[\int e^x \sin (5x) \, dx = \tfrac{1}{26}e^x\sin(5x)-\tfrac{5}{26}e^x\cos(5x) +C\]