Some integrals involving products of different types of functions can be evaluated using high school algebra or the substitution rule. However, when you encounter an integral consisting of the product of two functions, like a polynomial and an exponential, you will often need integration by parts. Keep reading to see integration by parts explained with examples.
Please refer to my Integration by Parts Infographic for a visual illustration of this method.
The Integration by Parts Formula
The integration by parts formula can be derived by integrating the product rule for derivatives.
$$(fg)’ = f’g + fg’$$
$$ \int (fg)’ dx = \int f’g + fg’ dx.$$
We now use the first part of The Fundamental Theorem of Calculus on the left-hand side and linearity on the right-hand side. We also apply the substitutions u = f and v = g:
$$ uv = \int vdu + \int udv. $$
Subtracting \( \int vdu \) from both sides, we arrive at the integration by parts formula, or
$$\int udv = uv – \int vdu.$$
Integration by parts aims to obtain an integral \( \int vdu \) that can be solved via other methods or is at least simpler than \( \int udv \).
How to Use Integration by Parts
While it is important to know the integration by parts formula, it is also important to be able to apply the method properly. We now discuss the procedure.
Step 1: Choose u and dv
The first and most challenging step in using integration by parts is choosing u and dv. Occasionally, you’ll make the wrong choices, but that’s okay. You can always come back and make different choices. Here are a few general guidelines for choosing u and dv:
- The product udv should consist of the entire integrand and differential.
- The function u should get simpler upon differentiation, or at the very least, no more complicated.
- dv should not be any more complicated upon integrating.
- If stuck, choose u in the following priority: logarithms > inverse functions > algebraic functions > trigonometric functions > exponentials.
- If all else fails, choose dv to be the most complicated part of the integrand that can be integrated without integration by parts.
Step 2: Compute du and v
Once we have chosen the functions \( u = f(x) \) and \( v = g(x)dx \), the next step is to compute \( du = f'(x)dx \) and \( v = \int g(x)dx \).
If you need help with the derivative, please check out my article
on How to Differentiate a Function Step by Step: A Beginner’s Guide. For assistance with the integral, please refer to my article, Basic Integration Problems for Beginners.
Step 3: Apply the Formula
Now that we have chosen u and dv and computed du and v, we can substitute everything into the integration by parts formula. At this stage, we should have a simpler integral to compute, which indicates we are on the right track. If not, it may be necessary to go back to step 1 and choose a different u and dv.
Step 4: Solve the Remaining Integral
Now, we compute the remaining integral using another method or apply integration by parts again.
Worked Out Examples
We now do some examples. Our first example illustrates the procedure.
Example 1: Evaluate the integrals:
(a) \( \int xe^x dx \).
Solution: Choose \( u = x \) and \( dv = e^xdx \), then \( du = dx \) and \( v = e^x \). Applying the integration by parts formula then gives
$$\int x e^x \, dx = x e^x – \int e^x dx = x e^x – e^x + C.$$
(b) \( \int x\sin{x} \).
Solution: Choose \( u = x \) and \( dv = \sin xdx \), then \( du = dx \) and \( v = -\cos x \). Applying the integration by parts formula then gives
$$ \int x \sin x \, dx = -x \cos x + \int \cos x dx = -x \cos x + \sin x + C.$$
(c) \( \int \ln{x} dx \).
Solution: Choose \( u = \ln x \) and \( dv = dx \), then \( du = \frac{1}{x}dx \) and \( v = x \). Applying the integration by parts formula then gives
$$ \int \ln x \, dx = x \ln x – \int dx = x \ln x – x + C.$$
Next is an example where integration by parts must be applied multiple times.
Example 2: Evaluate \( \int x^2e^x dx \).
Solution: Choose \( u = x^2 \) and \( dv = e^xdx \), then \( du = 2xdx \) and \( v = e^x \). Applying the integration by parts formula then gives
$$\int x^2 e^x \, dx = x^2 e^x – \int 2xe^x dx.$$
We now apply integration by parts again. This time choose \( u = -2x \) and \( dv = e^xdx \), then \( du = -2dx \) and \( v = e^x \).
Applying the integration by parts formula again, we obtain
$$\int x^2 e^x \, dx = x^2 e^x – 2xe^x + \int2e^x = x^2 e^x – 2xe^x + 2e^x + C.$$
Next, we give an example where an application of integration by parts leads to an integral requiring the substitution rule to solve. If you need a refresher on how the substitution rule works, please refer to The Ultimate Step-by-Step Guide to Solving Integrals Using Substitution.
Example 3: Compute the integrals:
(a) \( \int \arcsin{x}dx \)
Solution: Choose \( u = \arcsin{x} \) and \( dv = dx \), then \( du = \frac{1}{\sqrt{1 – x^2}} dx \) and \( v = x \). Applying the integration by parts formula then gives
$$\int \arcsin{x} \, dx = x \arcsin{x} – \int \frac{x}{\sqrt{1 – x^2}} dx.$$
For the remaining integral, we use substitution. Let \( u = 1 – x^2 \), then \( du = – 2xdx \). Or upon dividing both sides by 2, we get \( \frac{1}{2}du = -xdx \). Substituting into the integral, we obtain
$$\int \arcsin{x} \, dx = x \arcsin{x} + \frac{1}{2} \int \frac{1}{\sqrt{u}} du = x \arcsin{x} + \frac{1}{2} \int u^{-\frac{1}{2}} du = x \arcsin{x} + u^{\frac{1}{2}} + C = x \arcsin{x} + \sqrt{u} + C.$$
Back substituting, we arrive at
$$ x \arcsin{x} + \sqrt{1 – x^2} + C.$$
(b) \( \int \arctan{x} dx \)
Solution: Choose \( u = \arctan{x} \) and \( dv = dx \), then \( du = \frac{1}{x^2 + 1} dx \) and \( v = x \). Applying the integration by parts formula then gives
$$\int \arctan{x} \, dx = x \arctan{x} – \int \frac{x}{x^2 + 1} dx.$$
For the remaining integral, we use substitution. Let \( u = x^2 +1 \), then \( du = 2xdx \). Or upon dividing both sides by 2, we get \( \frac{1}{2}du = xdx \). Substituting into the integral, we obtain
$$\int \arctan{x} \, dx = x \arctan{x} – \frac{1}{2} \int \frac{1}{u} du = x \arctan{x} – \frac{1}{2} \int \frac{1}{u} du = x \arctan{x} – \frac{1}{2}\ln{u} + C = x \arctan{x} – \frac{1}{2}\ln{u} + C.$$
Back substituting, we arrive at
$$ x \arctan{x} – \frac{1}{2}\ln{(x^2 + 1)} + C.$$
We now give an example where a substitution is needed to compute v.
Example 4: Evaluate \( \int x^3e^{x^2} dx \).
Lemma: \( \int xe^{x^2} dx = \frac{1}{2}e^{x^2} \)
Let \( u = x^2 \) then \( du = 2dx \), or upon dividing both sides by 2 we get \( \frac{1}{2}du = dx \). Substituting into the integral, we obtain
$$\frac{1}{2}\int e^u \, du.$$
Integrating, we arrive at
$$\frac{1}{2}e^u,$$
or
$$\frac{1}{2}e^{x^2}.$$
Solution: Choose \( u = x^2 \) and \( dv = xe^{x^2}dx \), then \( du = 2x dx \) and \( v = \frac{1}{2}e^{x^2} \). Applying the integration by parts formula then gives
$$\int x^3e^{x^2} dx = \frac{1}{2}x^2e^{x^2} – \int xe^{x^2} dx = \frac{1}{2}x^2e^{x^2} – \frac{1}{2}e^{x^2}.$$
The next integrals require either algebraic manipulation or substitution before the opportunity to use integration by parts presents itself. The integrals are admittedly more challenging than those you’ll encounter in your calculus course.
Example 5: Compute
(a) \( \int e^{\sqrt[3]{x}} dx \)
Solution: We start with a substitution. Let \( u = \sqrt[3]{x} \), which implies that \( u^3 = x \), thus \( 3u^2du = dx \). Substituting into the integral, we get
$$\int 3u^2e^u du.$$
Choose \( v = 3u^2 \) and \( dw = e^udu \), then \( dv = 6udu \) and \( w = e^u \). Applying the integration by parts formula then gives
$$\int 3u^2 e^u \, du = 3u^2 e^u – \int 6ue^u du.$$
We now apply integration by parts again. This time choose \( v = -6u \) and \( dw = e^udu \), then \( dv = -6du \) and \( w = e^u \). Applying the integration by parts formula again, we obtain
$$\int 3u^2 e^u \, du = 3u^2 e^u – 6ue^u + \int6e^u du = 3u^2 e^u – 6ue^u + 6e^u + C,$$
or upon back substituting,
$$\int e^{\sqrt[3]{x}} \, dx = 3\sqrt[3]{x^2} e^{\sqrt[3]{x}} – 6\sqrt[3]{x}e^{\sqrt[3]{x}} + 6e^{\sqrt[3]{x}} + C.$$
.(b) \( \int \frac{\ln{x}}{(\ln{x} + 1) ^ 2 } dx \)
Lemma: \( \int \frac{1}{x(\ln{x} + 1)^2} dx = -\frac{1}{\ln{x} + 1} \)
Let \( u = \ln{x} + 1 \) then \( du = \frac{1}{x} dx \). Substituting into the integral, we obtain
$$\int \frac{1}{u^2} \, du = \int u ^{-2} du.$$
Integrating, we arrive at
$$- u^{-1} = – \frac{1}{u},$$
or
$$- \frac{1}{\ln{x} + 1}.$$
Solution: Multiplying the numerator and denominator by x gives
$$\int \frac{x\ln{x}}{x(\ln{x} + 1) ^ 2 } dx.$$
Choose \( u = x\ln x \) and \( dv = \frac{1}{x(\ln{x} + 1)^2}dx \), then \( du = (\ln{x} + 1)dx \) and \( v = -\frac{1}{\ln{x} + 1} \). Applying the integration by parts formula then gives
$$ \int \frac{x\ln{x}}{x(\ln{x} + 1) ^ 2 } dx = -\frac{x\ln{x}}{\ln{x} + 1} + \int dx = -\frac{x\ln{x}}{\ln{x} + 1} + x + C = \frac{x}{\ln{x} + 1} + C.$$
Our final example, before we move on to definite integrals, demonstrates that integrating by parts may not give a simpler integrand, but nevertheless, we can still compute the integrals. Part a gives an example where we can algebraically “solve” for the line integral, while part b involves a cancellation.
Example 6: Evaluate:
(a) \( \int e^x\sin{x} dx \)
Solution: Set \( I = \int e^x\sin{x} dx \). Choose \( u = \sin{x} \) and \( dv = e^xdx \), then \( du = \cos{x}dx \) and \( v = e^x \). Applying the integration by parts formula then gives
$$I = \sin{x} e^x – \int \cos{x}e^x dx.$$
(We now apply integration by parts again. This time choose \( u = -\cos{x} \) and \( dv = e^xdx \), then \( du = \sin{x}dx \) and \( v = e^x \). Applying the integration by parts formula again, we obtain
$$I = \sin{x} e^x – \cos{x}e^x – \int e^x\sin{x} dx = \sin{x} e^x – \cos{x}e^x – I.$$
Finally, we add I to both sides of the equation, then divide both sides by 2:
$$2I = \sin{x} e^x – \cos{x}e^x + C$$
$$I = \frac{1}{2}\sin{x} e^x – \frac{1}{2}\cos{x}e^x + C.$$
(b) \( \int \frac{\ln{x} – 1}{\ln^2{x}} dx \)
Lemma: \(- \int \frac{1}{x\ln^2{x}} dx = \frac{1}{\ln{x}} \)
Let \( u = \ln{x} \) then \( du = \frac{1}{x} dx \). Substituting into the integral, we obtain
$$- \int \frac{1}{u^2} \, du = – \int u ^{-2} du.$$
Integrating, we arrive at
$$u^{-1} = \frac{1}{u},$$
or
$$\frac{1}{\ln{x}}.$$
Solution: Split the integral into two using linearity:
$$\int \frac{1}{\ln{x}} dx – \int \frac{1}{\ln^2{x}} dx.$$
Next, multiply the numerator and denominator of the second integral by x to obtain
$$\int \frac{1}{\ln{x}} dx – \int \frac{x}{x\ln^2{x}} dx.$$
Choose \( u = x \) and \( dv = – \frac{1}{x\ln^2{x}}dx \), then \( du = dx \) and \( v = \frac{1}{\ln{x} } \). Applying the integration by parts formula then gives
$$\int \frac{1}{\ln{x}} dx + \frac{x}{\ln{x}} – \int \frac{1}{x\ln^2{x}} dx = \frac{x}{\ln{x}} + C.$$
Integration by Parts with Definite Integrals
If you’re dealing with definite integrals, apply the limits to the uv term first, then evaluate the remaining integral.
Here is an Example.
Example 7: Calculate \( \int_0^1 e^x dx \).
Solution: Solution: Choose \( u = x \) and \( dv = e^xdx \), then \( du = dx \) and \( v = e^x \). Applying the integration by parts formula then gives
$$\int_0^1 x e^x \, dx = x e^x |_0^1 – \int_0^1 e^x dx = e – \int_0^1 e^x dx = e – e^x |_0^1 = e – (e – 1) = 1.$$
Conclusion
Integration by parts can be tricky at first, but as you do more practice problems, it’ll start making sense. The key is knowing when to use it and how to pick your functions wisely.