Integration By Parts

Lesson Features »

Lesson Priority: High

 
Objectives
  • Memorize and use integration by parts formula
  • Recognize when this is the correct approach
  • Use Integration By Parts formula recursively
  • Apply the tabular approach to integrating certain common recursive forms
  • After gaining mastery of the process, learn how to use IBP correctly with definite integration
Lesson Description

Another technique we commonly use to solve more complex integration problems is the method of Integration By Parts (IBP). First we'll focus on indefinite integration to learn how to use the formula both on its own and recursively, and then we'll see what changes for definite integrals.

 
Practice Problems

Practice problems and worksheet coming soon!

 

Not Your Father's Product Rule

A continuing theme in the study of integration is that while we can find the derivative of virtually anything, not every function has an antiderivative. However, we have a series of common tools and formulas to try.The next method you need to know at this point is called Integration By Parts (IBP - yes I'm that lazy), and it's pretty much a take on the derivative product rule. In fact it can be derived from the Product Rule and the Fundamental Theorem of Calculus very quickly, but I've saved it as a practice example at the end of the lesson since a good handful of Profs ask you to do it yourself.
You Should Know
In some ways, Integration By Parts is a product rule for integration, and in other ways, it isn't. First and most importantly, you should understand the mechanics and how-to, but second and also importantly, you should develop intuition about when you can and can't use this method. Practice is the best medicine.

The IBP Formula

The first step in IBP success is memorizing the formula.
Define: Integration By PartsLet $u$ and $v$ represent single variable functions of $x$. Then the following indefinite integral expression holds true:$$\int u \, dv = uv - \int v \, du$$In applications where we need to integrate with limits (definite integration):$$\int^{b}_{a} u \, dv = uv \Bigg\rvert^{b}_{a} - \int^{b}_{a} v \, du$$
An overwhelming majority of teachers and profs require you to memorize it. The AP exam does as well!However, it's not even remotely enough to know the formula by heart - you also need to understand how it is implemented.

IBP in Action

The major steps for using IBP are
  • Pick what $u$ and $dv$ each are
  • Take the derivative of $u$ to get $du$, take the integral of $dv$ to get $v$
  • Plug into the formula
Simple enough to say - so let's check out an example.
 
Example 1Evaluate the following indefinite integral.$$\int x \sin(x) \, dx$$$\blacktriangleright$ First, we need to pick $u$ and $dv$:$$u = x$$$$dv = \sin(x) \, dx$$We'll soon discuss why we made these choices and not vice versa. Now that we've made the choices, we need to differentiate and integrate:$$\begin{align} u = x \, & \longrightarrow du = dx \\ dv = \sin(x) \, dx & \longrightarrow v = -\cos(x) \end{align}$$These steps should look familiar to how the mechanics work in u substitutions ». For example, if you made the $u$ sub $u = -\cos(x)$, the substitution step you would end up with is $du = \sin(x) \, dx$.Next, plug in these results into the formula.$$\int u \, dv = uv - \int v \, du$$$$\Rightarrow \int x \sin(x) \, dx = x (-\cos(x)) - \int (-\cos(x)) \, dx$$Cleaning up a bit,$$\int x \sin(x) \, dx = -x \cos(x) + \int \cos(x) \, dx$$Finally, all we need to do is execute the integral on the right-hand side, which is a feasible integral that we can compute "straight-up".$$\int x \sin(x) \, dx = -x \cos(x) + \sin(x) + C$$And we're done!
 
Pro Tip
Don't get hung up on the concept behind turning your choices for $u$ and $dv$ into the $du$ and $v$ pieces that the formula requires. Both actions are mechanically similar to what we do for u substitutions », either forward ($u$ to $du$) or backward ($dv$ to $v$). After a few problems you'll be confident.

A Definite Example

Let's do a slightly modified version of Example 1 so we can focus on how the game changes slightly if we are integrating definitely (that is, integrating with limits).
 
Example 2Integrate$$\int_{0}^{\pi/2} x \sin(x) \, dx$$$\blacktriangleright$ We can largely shortcut our work since the structure of the formula is the same as Example 1. Namely:$$\begin{align} u = x \, & \longrightarrow du = dx \\ dv = \sin(x) \, dx & \longrightarrow v = -\cos(x) \end{align}$$and$$\int_{0}^{\pi/2} x \sin(x) \, dx = -x \cos(x) \Bigg\rvert_{0}^{\pi/2} + \int_{0}^{\pi/2} \cos(x) \, dx$$since, from Example 1,$$\int x \sin(x) \, dx = -x \cos(x) + \int \cos(x) \, dx$$Now, let's evaluate.$$-x \cos(x) \Bigg\rvert_{0}^{\pi/2} + \int_{0}^{\pi/2} \cos(x) \, dx$$$$= -x \cos(x) \Bigg\rvert_{0}^{\pi/2} + \sin(x) \Bigg\rvert_{0}^{\pi/2}$$$$=\left[ \left(-\frac{\pi}{2}\cdot 0\right) - (0 \cdot 1) \right] + \left[ 1 - 0 \right]$$$$=1$$
 

Developing Intuition

When learning the ropes of integration, it's important to follow what I often refer to as the "pecking order" for integration processes. Since you'll learn a small handful of techniques, it's best to try the simpler ones first if you aren't sure which to use.The problems that require Integration by Parts often look similar to problems that require the $u$ substitution method. If you're not sure which way to go, you should attempt $u$ substitution first because it's faster to try. While the only way to gain true expertise is practice, there are a few structures that strongly suggest IBP is required. IBP is often required for integrating things like:
  • An $x$ term multiplied by an exponential term
  • An $x$ term multiplied by a trig function
  • An exponential term multiplied by a trig function
  • Complicated expressions involving $\ln(x)$
Example 1 was a case where we had $x$ multiplied by $\sin(x)$. In the cases with an $x$ term, you should let the $x$ term be the "$u$" and the other thing be the "$dv$".Here's a quick similar example of how things work with $x$ terms and exponentials.
 
Example 3Evaluate $\int x e^{-x} \, dx$.$\blacktriangleright$ Let's start by defining $u$ and $dv$.$$u = x$$$$dv = e^{-x}$$Next, differentiate $u$ and integrate $dv$:$$\begin{align} u = x \, & \longrightarrow du = dx \\ dv = e^{-x} \, dx & \longrightarrow v = -e^{-x} \end{align}$$Plug into the formula:$$\int u \, dv = uv - \int v \, du$$$$\int x e^{-x} \, dx = (x)(-e^{-x}) - \int (-e^{-x}) \, dx$$$$ = -xe^{-x} + \int e^{-x} \, dx$$$$ = -xe^{-x} - e^{-x} + C$$
Warning!
If you try IBP on a problem that has a monomial of the form $x^n$, don't pick that piece to be $dv$ (with one exception noted in the next paragraph). If you do, you'll enter a mathematical death spiral where you get iterative intergrals with ever-increasing powers of $x$.
While we almost never want to pick $dv$ to be the $x$ term, an odd exception (and generally, an odd problem) occurs when logarithms are thrown in the mix and $u$ substitution fails. In those cases, we may need IBP in a way you may not expect: it's the log term in that case that we need to set equal to $u$, and the $x$ term that we must set $dv$ equal to. For this reason, these problems are considered a little more difficult because they tend to catch students off guard.
 
Example 4Evaluate the indefinite integral$$\int x\ln(x) \, dx$$$\blacktriangleright$ When logarithms are mixed with other variable terms, the correct choice for $u$ and $dv$ may be less intuitive. Here, let's set $u$ equal to $\ln(x)$ and $dv$ equal to $x$:$$u = \ln(x) \longrightarrow du = \frac{1}{x} \,\, dx$$$$dv = x \longrightarrow v = \frac{x^2}{2}$$Now, plug into the formula:$$\int u \, dv = uv - \int v \, du$$$$\int x\ln(x) \, dx = \frac{x^2}{2} \cdot \ln(x) - \int \frac{x^2}{2} \cdot \frac{1}{x} \, dx$$$$= \frac{x^2 \ln(x)}{2} - \int \frac{x}{2} \, dx$$$$= \frac{x^2 \ln(x)}{2} - \frac{x^2}{4} + C$$
 

Mr. Math Makes It Mean

Iterative IBPIf you have an $x$ term with a power of $2$ or more multiplied by either a trigonometric or exponential term, we have to perform Integration by Parts iteratively. In short, this means that the integral on the right side of our process is one that itself requires IBP to compute.The challenge here is to keep everything straight, both in your head and on paper. It can be difficult to show your scratch work in an organized manner when so much is going on.
 
Example 5Integrate.$$\int x^2 \cos(x) \, dx$$$\blacktriangleright$ Let's start with picking $u$ to be $x^2$ and $dv$ to be $\cos(x)$.$$\begin{align} u = x^2 \, & \longrightarrow du = 2x \, dx \\ dv = \cos(x) \, dx & \longrightarrow v = \sin(x) \end{align}$$Let's plug these results into the IBP formula:$$\int u \, dv = uv - \int v \, du$$$$\int x^2 \cos(x) \, dx = x^2 \sin(x) - \int \sin(x) \cdot 2x \, dx $$Upon examination of what we're left with on the right side, it becomes quickly clear that regrettably, we need to use IBP again on the resulting integral.One of the main challenges with needing to use IBP within a problem that we're already using IBP is that it's difficult to maintain clean and coherent scratch work to properly show your grader what you're doing. I recommend doing this "secondary" integral totally separately and then clearly show how you plug the result back into the main problem (by using boxes, arrows, etc. in your scratch work).Let's now evaluate the secondary integral.$$\int 2x \sin(x) \, dx$$Let's choose $u$ to be $2x$ and $dv$ to be $\sin(x) \, dx$:$$\begin{align} u = 2x \, & \longrightarrow du = 2 \, dx \\ dv = \sin(x) \, dx & \longrightarrow v = -\cos(x) \end{align}$$Plugging in:$$\int u \, dv = uv - \int v \, du$$$$\int 2x \sin(x) \, dx = -2x\cos(x) - \int 2 \cdot (-cos(x)) \, dx $$$$ = -2x \cos(x) + 2 \int \cos(x) \, dx$$$$ = -2x \cos(x) + 2\sin(x) + C$$Let's take this secondary integral result and plug it into the original problem where we left off:$$\int x^2 \cos(x) \, dx = x^2 \sin(x) - \int \sin(x) \cdot 2x \, dx $$$$= x^2 \sin(x) - \Bigg[ -2x \cos(x) + 2\sin(x) + C \Bigg]$$$$= x^2 \sin(x) + 2x\cos(x) - 2\sin(x) + C$$Remember that the $+C$ is often written positive regardless of what happens with cleanup and distributing negative signs because it can represent any real number constant, positive or negative.
 
"Trick Shot" IBPIn order to integrate the product of an exponential term and a sinusoid, an unintuitive technique is required, which means teachers absolutely love to throw this on tests (and the mean ones won't even teach you the technique, they expect you to figure it out!).Let's learn by doing.
 
Example 6Integrate.$$\int e^{x} \sin(x) \, dx$$$\blacktriangleright$ This integral requires iterative IBP but does not terminate on its own, and so I call this "trick shot" IBP. Start by letting $u$ be the exponential term and letting $dv$ be the other.$$\mathrm{Let} \,\,\,\, u = e^{x} \longrightarrow du = e^{x} \, dx$$$$\mathrm{Let} \,\,\,\, dv = \sin(x) \, dx \longrightarrow v = -\cos(x)$$Plug these items into the IBP formula:$$\int u \, dv = uv - \int v \, du$$$$\int e^{x} \sin(x) \, dx = -e^{x} \cos(x) - \int (-\cos(x))\left( e^{x} \right) \, dx$$$$ = -e^{x} \cos(x) + \int e^{x} \cos(x) \, dx$$The integral on the right-hand side is one that itself requires IBP, so be sure to use plenty of space on your work paper and show carefully what you are doing. Let's now calculate that integral separately using IBP and once again letting $u$ equal the exponential term and letting $dv$ be the other thing.$$\int e^{x} \cos(x) \, dx$$$$\mathrm{Let} \,\,\,\, u = e^{x} \longrightarrow du = e^{x} \, dx$$$$\mathrm{Let} \,\,\,\, dv = \cos(x) \, dx \longrightarrow v = \sin(x)$$Plugging into the IBP formula:$$\int e^{x} \cos(x) \, dx = e^{x} \sin(x) - \int e^{x} \sin(x) \, dx$$Take this result and feed it back into the original problem (again be sure to clearly show your grader what you're doing):$$\int e^{x} \sin(x) \, dx = -e^{x} \cos(x) + \Bigg[ e^{x} \sin(x) - \int e^{x} \sin(x) \, dx \Bigg]$$We've reached the point where the unusual technique is required - we have the same expression on the right-hand side as we do on the left side. If you think of the original integral as one big variable, imagine adding it to both sides of the equation:$$\int e^{x} \sin(x) \, dx = -e^{x} \cos(x) + e^{x} \sin(x) - \int e^{x} \sin(x) \, dx$$$$+\int e^{x} \sin(x) \, dx \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; + \int e^{x} \sin(x) \, dx$$$$\Rightarrow 2 \int e^{x} \sin(x) \, dx = -e^{x} \cos(x) + e^{x} \sin(x) + C$$All we have to do to finish the problem is divide by $2$.$$\int e^{x} \sin(x) \, dx = \frac{-e^{x} \cos(x) + e^{x} \sin(x)}{2} + C$$
 
Super Iterative IBP - Tabular MethodIntegrals that we know will require iterative IBP, especially ones of the form $\int x^{n} e^{kx}$, can be handled efficiently due to the patterns that appear. The following table-based method is a fast and accurate way to handle iterative IBP in cases where two or more iterations are required. Recall from Example 5 that we needed to do IBP twice to integrate $x^2 \cos(x)$ - well, we would need to use IBP iterative four times to integrate something like $x^4 e^{3x}$. Doing it out properly with four levels of substitution would make us really sad.
IBP - Tabular ApproachFor integrals of the form$$\int p(x) \cdot f(x) \, dx$$where $p(x)$ is a polynomial, follow these steps to obtain the final answer without manually setting up multiple IBP iterative substituions:
  • Set up a blank two-column table.
  • Take the derivative of $p(x)$ over and over until you get $0$. List the results in the first column, starting with the original $p(x)$ and including $0$ for the last row.
  • Integrate $f(x)$ repetitively and list the results in the second column, starting with the original $f(x)$. Have a match for every item in the first column, including the last $0$.
  • Draw an arrow from each item in column one to the item in column two that is one row down. Label each arrow with alternating $+$ and $-$ signs, starting with $+$ on the first one.
  • Add the products of the items you drew arrows to.
This seems fairly complicated due to the number of steps involved, but it truly is easier than outright integration. It's also easier to see it done in practice than to read about it!
 
Example 7Use the tabular approach to IBP to integrate$$\int (x^3 - 8x^2 + 6x + 3) \cdot \sin(x) \, dx$$$\blacktriangleright$ First, set up a blank table. Let's populate its rows with the derivatives of the polynomial, including a zero row:Now, take $\sin(x)$ and integrate it iteratively, populating the right side of the chart until we've filled all the rows we need.Add in your arrows and $+$ / $-$ signs:Multiply objects connected by arrows and add. The added result is the answer to the original problem. Don't forget your $+C$!$$\int (x^3 - 8x^2 + 6x + 3) \cdot \sin(x) \, dx$$$$= \left( 3x^2 - 16x + 6 - 6 \right) \sin(x) + \left(-x^3 +8x - 19\right) \cos(x) + C$$$$ = \left( 3x^2 - 16x \right) \sin(x) - \left(x^3 - 8x + 19\right) \cos(x) + C$$
 

Unusual Suspects

As we said, most of the time when we need IBP it will be for integrals that we practiced with forms of $x^n$, exponentials, and sinusoids. It can be used occasionally in an unusual way where you let $dv$ equal $dx$, and the formula works. Let's look at the most common example of this.
 
Example 8Integrate $\int \ln(x)\, dx$.$\blacktriangleright$ While this does not at all look like an integration by parts problem, it is one in disguise. Let $u$ be $\ln(x)$ and let $dv$ be $dx$.$$\begin{align} u = \ln(x) \, & \longrightarrow du = \frac{1}{x} \, dx \\ dv = dx & \longrightarrow v = x \end{align}$$Plugging into the formula:$$\int u \, dv = uv - \int v \, du$$$$\int \ln(x) \, dx = x\ln(x) - \int x \cdot \frac{1}{x} \, dx$$$$ = x\ln(x) - \int 1 \, dx$$$$ = x\ln(x) - x + C$$This is indeed the way to derive the integral of $\ln(x)$. Some teachers don't bother with the derivation and just tell students to memorize it. In either case, that's the result!
 
Keep an eye out for other funky integrals that contain $\ln(x)$ which aren't feasible using simpler methods like $u$ substitution. IBP used in this way may just work!

Put It To The Test

Try these for yourself, but remember that while the following problems all require IBP since this lesson focuses on it, the challenge on tests is to recognize when you need it out of context, among any random mix of integrals you may need to solve. As you work each problem, focus on why IBP works for that particular problem!
 
Example 9Derive the formula for indefinite Integration by Parts using the Product Rule for derivatives.
Show solution
$\blacktriangleright$ Not all teachers teach or expect students to be able to derive things, but this is a fairly quick exercise and is often asked for that reason alone.Start with the product rule for derivatives for functions $f$ and $g$, which are each single variable functions of $x$. Let's use differential notation:$$\frac{d}{dx} \, \big[ f(x) \cdot g(x) \big] = \left[ \frac{d}{dx} \, f(x) \right] \cdot g(x) + f(x) \cdot \left[ \frac{d}{dx} \, g(x) \right]$$Now, integrate both sides. The right side is a sum, so we can just integrate each piece separately.$$\int \frac{d}{dx} \, \big[ f(x) \cdot g(x) \big] \, dx = \int \left[ \frac{d}{dx} \, f(x) \right] \cdot g(x) \, dx + \int f(x) \cdot \left[ \frac{d}{dx} \, g(x) \right] \, dx$$Recall that by the Fundamental Theorem of Calculus », the integral of the derivative of a function is just the function itself.On the left side, this means that the integral of the derivative of $f$ times $g$ is just $f$ times $g$.$$ f(x) \cdot g(x) = \int \left[ \frac{d}{dx} \, f(x) \right] \cdot g(x) \, dx + \int f(x) \cdot \left[ \frac{d}{dx} \, g(x) \right] \, dx$$On the right side, we can't apply the Fundamental Theorem to either term because the derivatives are not solo expressions. However, let's move the first term on the right-hand side to the left-hand side:$$f(x) \cdot g(x) - \int \left[ \frac{d}{dx} \, f(x) \right] \cdot g(x) \, dx = \int f(x) \cdot \left[ \frac{d}{dx} \, g(x) \right] \, dx$$And for clarity, let's simply switch sides (everything on the left moves to the right and vice versa)$$\int f(x) \cdot \left[ \frac{d}{dx} \, g(x) \right] \, dx = f(x) \cdot g(x) - \int \left[ \frac{d}{dx} \, f(x) \right] \cdot g(x) \, dx$$Finally, let's simply make a labelling change. If we let $u = f(x)$ then$$\frac{du}{dx} = \frac{d}{dx} \, f(x)$$$$\longrightarrow du = \frac{d}{dx} \, f(x) \, dx$$And, if we let $dv/dx = \frac{d}{dx} \, g(x)$, then$$dv = \frac{d}{dx} \, g(x) \, dx$$and$$v = \int \frac{d}{dx} \, g(x) = g(x)$$Replace these new $u$ and $v$ variables into our expression, and now we have:$$\int u \, dv = uv - \int v \, du$$Which is exactly what the IBP formula looks like.
 
Example 10$$\int x \sec^{2} (x) \, dx$$
Show solution
$\blacktriangleright$ Knowing that we're integrating a polynomial term multiplied with a trig function, let's try IBP with $u$ equal to $x$ and $dv$ equal to $\sec^2 (x) \, dx$.$$\begin{align} u = x \, & \longrightarrow du = dx \\ dv = \sec^2 (x) \, dx & \longrightarrow v = \tan(x) \end{align}$$This worked out particularly well because $\sec^2 (x)$ has a nice derivative - another thing to consider when evaluating which technique you might want to use when calculating general integrals.Proceeding with the IBP formula:$$\int u \, dv = uv - \int v \, du$$$$\int x \sec^{2} (x) \, dx = x \tan(x) - \int \tan(x) \, dx$$This isn't a "no-brainer" integral, since most teachers won't have you memorize the integral of $\tan(x)$ and it doesn't have a one-step answer. However, it is an integral you've likely seen before and you will certainly be expected to figure it out. All we need to do is rewrite $\tan(x)$ and use u-substitution ».$$\int \tan(x) \, dx = \int \frac{\sin(x)}{\cos(x)} \, dx$$$$ \Rightarrow \ln|\cos(x)| + C$$Plugging this result in, the overall answer is$$\int x \sec^{2} (x) \, dx = x \tan(x) - \ln|\cos(x)| + C$$
 
Example 11$$\int_{0}^{4} xe^{3x} \, dx$$
Show solution
$\blacktriangleright$ All we have to do differently for this problem is deal with the integration limits, and plugging them in accordingly.Let's let $u$ be $x$ and $dv$ be $e^{3x} \, dx$.$$\begin{align} u = x \, & \longrightarrow du = dx \\ dv = e^{3x} \, dx & \longrightarrow v = \frac{e^{3x}}{3} \end{align}$$$$\int_{a}^{b} u \, dv = uv \Bigg\rvert_{a}^{b} - \int_{a}^{b} v \, du$$$$\int_{0}^{4} xe^{3x} \, dx = \frac{xe^{3x}}{3}\Bigg\rvert_{0}^{4} - \frac{1}{3} \, \int_{0}^{4} e^{3x} \, dx$$$$\int_{0}^{4} xe^{3x} \, dx = \frac{xe^{3x}}{3}\Bigg\rvert_{0}^{4} - \frac{e^{3x}}{9}\Bigg\rvert_{0}^{4}$$$$\int_{0}^{4} xe^{3x} \, dx = e^{3x} \cdot \left( \frac{x}{3} - \frac{1}{9} \right) \Bigg\rvert_{0}^{4}$$$$=e^{12} \cdot \frac{11}{9} + \frac{1}{9}$$
 
Example 12$$\int e^{3x} \cos(5x) \, dx$$
Show solution
$\blacktriangleright$ Hopefully you recognize that this is the tricky type of integral that requires solving for itself (see trick shot IBP » above). We'll need to use IBP twice in order to get what we need.Let $u$ be $e^{3x}$ and $dv$ be $\cos(5x) \, dx$.$$\begin{align} u = e^{3x} \, & \longrightarrow du = 3e^{3x} \, dx \\ dv = \cos(5x) \, dx & \longrightarrow v = \frac{\sin(5x)}{5} \end{align}$$$$\int u \, dv = uv - \int v \, du$$$$\int e^{3x} \cos(5x) \, dx = \frac{e^{3x}\sin(5x)}{5} - \int \frac{\sin(5x)}{5} \cdot 3e^{3x} \, dx$$$$ = \frac{e^{3x}\cos(5x)}{5} - \frac{3}{5} \int e^{3x} \sin(5x) \, dx$$Now we'll need IBP for the second integral in our solution. Let's again let $u$ be the exponential term and let $dv$ be the rest.$$\begin{align} u = e^{3x} \, & \longrightarrow du = 3e^{3x} \, dx \\ dv = \sin(5x) \, dx & \longrightarrow v = -\frac{\cos(5x)}{5} \end{align}$$Plugging in:$$\int u \, dv = uv - \int v \, du$$$$\int e^{3x} \sin(5x) \, dx = -\frac{e^{3x}\cos(5x)}{5} - \int -\frac{\cos(5x)}{5} \cdot 3e^{3x} \, dx$$$$\int e^{3x} \sin(5x) \, dx = -\frac{e^{3x}\cos(5x)}{5} + \frac{3}{5} \int e^{3x} \cos(5x) \, dx$$Take this result and substitute it into the original problem:$$\int e^{3x} \cos(5x) \, dx = \frac{e^{3x}\sin(5x)}{5} - \frac{3}{5} \int e^{3x} \sin(5x) \, dx$$becomes$$\int e^{3x} \cos(5x) \, dx = $$$$\frac{e^{3x}\sin(5x)}{5} - \frac{3}{5} \Bigg[ -\frac{e^{3x}\cos(5x)}{5} + \frac{3}{5} \int e^{3x} \cos(5x) \, dx \Bigg]$$Distributing the negative three fifths,$$\int e^{3x} \cos(5x) \, dx = \frac{e^{3x}\sin(5x)}{5} + \frac{3e^{3x}\cos(5x)}{25} - \frac{9}{25} \int e^{3x} \cos(5x) \, dx$$Finally, we add the $9/25$ $\int$ expression to both sides of the problem$$\frac{34}{25} \int e^{3x} \cos(5x) \, dx = \frac{e^{3x}\sin(5x)}{5} + \frac{3e^{3x}\cos(5x)}{25} + C$$and multiply both sides by $25/34$$$ \int e^{3x} \cos(5x) \, dx = \frac{e^{3x}}{34} \bigg[ 5\sin(5x) + 3\cos(5x) \bigg] + C$$
 
Example 13$$\int x^2 e^{-4x} \, dx$$
Show solution
$\blacktriangleright$ Here, we'll need to use IBP twice.Start the first iteration by choosing $u$ to be the polynomial term, as is typical.$$\begin{align} u = x^2 \, & \longrightarrow du = 2x \, dx \\ dv = e^{-4x} \, dx & \longrightarrow v = -\frac{e^{-4x}}{4} \end{align}$$Plugging in,$$\int u \, dv = uv - \int v \, du$$$$\int x^2 e^{-4x} \, dx = -\frac{x^2 e^{-4x}}{4} - \int -\frac{e^{-4x}}{4} \cdot 2x \, dx$$$$ = -\frac{x^2 e^{-4x}}{4} + \frac{1}{2} \int x e^{-4x} \, dx$$The second integral will again require IBP. Let's let $u$ be $x$ and let the rest be $dv$:$$\begin{align} u = x \, & \longrightarrow du = dx \\ dv = e^{-4x} \, dx & \longrightarrow v = -\frac{e^{-4x}}{4} \end{align}$$Now,$$\int x e^{-4x} \, dx = -\frac{x e^{-4x}}{4} - \int -\frac{e^{-4x}}{4} \, dx $$$$ = -\frac{x e^{-4x}}{4} + \frac{1}{4} \int e^{-4x} \, dx$$$$ = -\frac{x e^{-4x}}{4} - \frac{e^{-4x}}{16} + C$$Putting everything together:$$\int x^2 e^{-4x} \, dx$$$$= -\frac{x^2 e^{-4x}}{4} + \frac{1}{2} \Bigg[ -\frac{x e^{-4x}}{4} - \frac{e^{-4x}}{16} + C \Bigg]$$$$= -\frac{1}{4} \cdot \left( x^2 + \frac{x}{2} + \frac{1}{8} \right) \cdot e^{-4x} + C$$or$$ - \frac{1}{32} \cdot \left( 8x^2 + 4x + 1 \right) \cdot e^{-4x} + C$$(sometimes teachers like you to factor out fractions to end up with a polynomial in your answer that has integer coefficients, but either answer is correct!)
 
Example 14$$\int \frac{\ln(x)}{\sqrt{x}} \, dx$$
Show solution
$\blacktriangleright$ This is one of the log type problems that will fail if you try to let the $u$ be the polynomial term. However IBP will work:$$\begin{align} u = \ln(x) \, & \longrightarrow du = \frac{1}{x} \, dx \\ dv = x^{-1/2} \, dx & \longrightarrow v = 2x^{1/2} \end{align}$$$$\int u \, dv = uv - \int v \, du$$$$ \int \frac{\ln(x)}{\sqrt{x}} \, dx = 2x^{1/2} \ln(x) - \int 2x^{1/2} \cdot \frac{1}{x} \, dx$$$$ = 2x^{1/2} \ln(x) - \int 2x^{-1/2} \, dx$$$$ = 2x^{1/2} \ln(x) - 4x^{1/2} + C$$$$ = 2\sqrt{x} \left( \ln(x) - 2 \right) + C$$
 
Example 15$$\int \cos(\ln(x)) \, dx$$
Show solution
$\blacktriangleright$ This is a fairly tricky problem, and it is not intuitive that Integration by Parts will be the winning technique. However, if you encountered this problem in the wild, you will have already tried the $u$-sub method and seen that it doesn't work.This problem is similar to $\int \ln(x) \, dx$. Let's let $u$ be the entire expression except for the differential - that will be our $dv$.$$\begin{align} u = \cos(\ln(x)) \, & \longrightarrow du = -\sin(\ln(x)) \cdot \frac{1}{x} \, dx \\ dv = dx & \longrightarrow v = x \end{align}$$Now, use the IBP formula.$$\int u \, dv = uv - \int v \, du$$$$\int \cos(\ln(x)) \, dx = x\cos(\ln(x)) - \int x \cdot \left(-\sin(\ln(x)) \cdot \frac{1}{x} \right)\, dx$$$$= x\cos(\ln(x)) + \int \sin(\ln(x)) \, dx$$Now, let's integrate this new integral that appeared using the same technique:$$\int \sin(\ln(x)) \, dx$$$$\begin{align} u = \sin(\ln(x)) \, & \longrightarrow du = \cos(\ln(x)) \cdot \frac{1}{x} \, dx \\ dv = dx & \longrightarrow v = x \end{align}$$$$\int \sin(\ln(x)) \, dx = x\sin(\ln(x)) - \int x \cdot \cos(\ln(x)) \cdot \frac{1}{x} \, dx$$$$ = x\sin(\ln(x)) - \int \cos(\ln(x)) \, dx$$Plugging this back into the original problem:$$\int \cos(\ln(x)) \, dx = x\cos(\ln(x)) + \Bigg[ x\sin(ln(x)) - \int \cos(\ln(x)) \, dx \Bigg]$$This is now a "trick shot" problem, where we can add the integral $\int \cos(\ln(x)) \, dx$ to both sides, yielding$$2 \int \cos(\ln(x)) \, dx = x\cos(\ln(x)) + x\sin(\ln(x)) + C$$The final step is to divide by $2$.$$\int \cos(\ln(x)) \, dx = \frac{1}{2} \left(x\cos(\ln(x)) + x\sin(\ln(x)) \right) + C$$Note that your teacher may want to have you change the logarithms expressions to $|\ln(x)|$, but this isn't usually a big deal.
 
Example 16Use IBP to evaluate the integral$$\int \tan^{-1}(x) \, dx$$
Show solution
$\blacktriangleright$ Similar to when we integrated $\ln(x)$, and the last problem, let $u$ be $\tan^{-1}(x)$ and let $dv$ be $dx$.$$\begin{align} u = \tan^{-1}(x) \, & \longrightarrow du = \frac{1}{1+x^2} \, dx \\ dv = dx & \longrightarrow v = x \end{align}$$Let's plug into the IBP formula:$$\int u \, dv = uv - \int v \, du$$$$\int \tan^{-1}(x) \, dx = x\tan^{-1}(x) - \int \frac{x}{1+x^2} \, dx$$Now, the secondary integral is a fairly simply $u$ sub problem.$$\int \frac{x}{1+ x^2} \, dx$$$$u = 1+x^2 \, \longrightarrow \, du = 2x \, dx$$$$\int \frac{x}{1+ x^2} \, dx = \frac{1}{2} \int \frac{2x}{1+x^2} \,dx$$$$=\frac{1}{2} \int \frac{1}{u} \, du$$$$= \frac{1}{2} \, \ln(u) + C$$$$= \frac{1}{2} \, \ln(1+x^2) + C$$Plugging this into the original problem gives us our answer:$$\int \tan^{-1}(x) \, dx = x\tan^{-1}(x) - \frac{1}{2} \, \ln(1+x^2) + C$$Note that here you don't even need absolute value bars around the $\ln$ in the answer because $1+x^2$ is a positive quantity!
 
Example 17Use tabular Integration by Parts to evaluate the following integral.$$\int (2x^2 - 3x + 7) e^{-x} \, dx$$
Show solution
The tabular method requires that we jot down the polynomial and its derivatives including a zero derivative, and then fill the other side with the iterative anti-derivatives of the exponential term.Include the arrows and plus and minus signs:Finally, add the products to get your final answer.$$\int (2x^2 - 3x + 7) e^{-x} \, dx$$$$ = -e^{-x} \left( 2x^2 + x + 8 \right) \, dx$$
 
Lesson Takeaways
  • Learn and memorize the Integration By Parts formula
  • Be familiar with the types of problems we usually need to apply this formula to
  • Know how to correctly adjust the problem for definite integration (with limits)
  • See unusual situations that require IBP and gain familiarity with these special cases through practice
  • See (and hopefully never need) the tabular approach for performing integrals that require several iterations of IBP in a single problem

Lesson Metrics

At the top of the lesson, you can see the lesson title, as well as the DNA of Math path to see how it fits into the big picture. You can also see the description of what will be covered in the lesson, the specific objectives that the lesson will cover, and links to the section's practice problems (if available).

Key Lesson Sections

Headlines - Every lesson is subdivided into mini sections that help you go from "no clue" to "pro, dude". If you keep getting lost skimming the lesson, start from scratch, read through, and you'll be set straight super fast.

Examples - there is no better way to learn than by doing. Some examples are instructional, while others are elective (such examples have their solutions hidden).

Perils and Pitfalls - common mistakes to avoid.

Mister Math Makes it Mean - Here's where I show you how teachers like to pour salt in your exam wounds, when applicable. Certain concepts have common ways in which teachers seek to sink your ship, and I've seen it all!

Put It To The Test - Shows you examples of the most common ways in which the concept is tested. Just knowing the concept is a great first step, but understanding the variation in how a concept can be tested will help you maximize your grades!

Lesson Takeaways - A laundry list of things you should be able to do at lesson end. Make sure you have a lock on the whole list!

Special Notes

Definitions and Theorems: These are important rules that govern how a particular topic works. Some of the more important ones will be used again in future lessons, implicitly or explicitly.

Pro-Tip: Knowing these will make your life easier.

Remember! - Remember notes need to be in your head at the peril of losing points on tests.

You Should Know - Somewhat elective information that may give you a broader understanding.

Warning! - Something you should be careful about.

Return to Lesson