Integration by Parts Explained with Examples: A Step-by-Step Guide
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.
The following infographic illustrates the concepts covered in this article.
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 \).
(b) \( \int x\sin{x} \).
(c) \( \int \ln{x} dx \).
Solution: (a) \( \int xe^x dx \).
Choose \( u = x \) and \( dv = e^xdx \), then \( du = dx \) and \( v = e^x \). Applying the integration by parts formula then gives
$$x e^x – \int e^x dx.$$
Evaluating the remaining integral gives a final answer of
$$x e^x – e^x + C.$$
(b) \( \int x\sin{x} \).
Choose \( u = x \) and \( dv = \sin xdx \), then \( du = dx \) and \( v = -\cos x \). Applying the integration by parts formula then gives
$$-x \cos x + \int \cos x dx.$$
Integrating gives a final answer of
$$-x \cos x + \sin x + C.$$
(c) \( \int \ln{x} dx \).
Choose \( u = \ln x \) and \( dv = dx \), then \( du = \frac{1}{x}dx \) and \( v = x \). Applying the integration by parts formula then gives
$$x \ln x – \int x\frac{1}{x} dx.$$
Simplifying, we obtain
$$x \ln x – \int dx.$$
Integrating, we arrive at a final answer of
$$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
$$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
$$x^2 e^x – 2xe^x + \int2e^x.$$
Applying the constant multiple rule gives
$$x^2 e^x – 2xe^x + 2\int e^x.$$
Integrating, we get a final answer of
$$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 \)
(b) \( \int \arctan{x} dx \)
Solution: (a) \( \int \arcsin{x}dx \)
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
$$x \arcsin{x} – \int \frac{x}{\sqrt{1 – x^2}} dx.$$
For the remaining integral, we use a substitution. Let \( u = 1 – x^2 \), then \( du = – 2xdx \). Dividing both sides by 2, we get \( \frac{1}{2}du = -xdx \). Substituting into the integral, we obtain
$$x \arcsin{x} + \frac{1}{2} \int \frac{1}{\sqrt{u}} du.$$
Rewriting the root as a fractional exponent gives
$$x \arcsin{x} + \frac{1}{2} \int \frac{1}{u^{\frac{1}{2}}} du.$$
This is equivalent to
$$x \arcsin{x} + \frac{1}{2} \int u^{-\frac{1}{2}} du.$$
Integrating, we get
$$x \arcsin{x} + u^{\frac{1}{2}} + C.$$
In terms of roots, this is
$$x \arcsin{x} + \sqrt{u} + C.$$
Back substituting, we arrive at a final answer of
$$ x \arcsin{x} + \sqrt{1 – x^2} + C.$$
(b) \( \int \arctan{x} dx \)
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
$$x \arctan{x} – \int \frac{x}{x^2 + 1} dx.$$
For the remaining integral, we use a substitution. Let \( u = x^2 +1 \), then \( du = 2xdx \). Dividing both sides by 2, we get \( \frac{1}{2}du = xdx \). Substituting into the integral, we obtain
$$x \arctan{x} – \frac{1}{2} \int \frac{1}{u} du.$$
Integrating gives
$$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 \).
Solution: First we show that, \( \int xe^{x^2} dx = \frac{1}{2}e^{x^2} \).
Let \( u = x^2 \) then \( du = 2xdx \). Dividing both sides by 2, we get \( \frac{1}{2}du = xdx \). Substituting into the integral, we obtain
$$\frac{1}{2}\int e^u \, du.$$
Integrating, we arrive at
$$\frac{1}{2}e^u,$$
Back substituting gives
$$\frac{1}{2}e^{x^2}.$$
Now we compute the original integral. 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
$$\frac{1}{2}x^2e^{x^2} – \int xe^{x^2} dx.$$
Integrating, we arrive at a final answer of
$$\frac{1}{2}x^2e^{x^2} – \frac{1}{2}e^{x^2} + C.$$
The following integrals require either algebraic manipulation or substitution before the opportunity to use integration by parts presents itself.
Example 5: Compute
(a) \( \int e^{\sqrt[3]{x}} dx \)
.(b) \( \int \frac{\ln{x}}{(\ln{x} + 1) ^ 2 } dx \)
Solution: (a) \( \int e^{\sqrt[3]{x}} dx \)
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
$$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
$$3u^2 e^u – 6ue^u + \int6 e^u du,$$
Applying the constant multiple rule, we get
$$3u^2 e^u – 6ue^u + 6\int e^u du,$$
Integrating gives
$$3u^2 e^u – 6ue^u + 6e^u + C,$$
Back substituting, we arrive at a final answer of
$$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 \)
First we show that, \( \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.$$
In terms of negative exponents, this is
$$\int u ^{-2} du.$$
Integrating, we arrive at
$$- u^{-1},$$
Rewriting in terms of positive exponents, we get
$$- \frac{1}{u},$$
Back substituting gives
$$- \frac{1}{\ln{x} + 1}.$$
Now we evaluate the original integral. 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
$$-\frac{x\ln{x}}{\ln{x} + 1} + \int \frac{\ln{x} + 1}{\ln{x} + 1} dx.$$
Simplifying the integrand, we obtain
$$-\frac{x\ln{x}}{\ln{x} + 1} + \int dx.$$
Integrating we get
$$-\frac{x\ln{x}}{\ln{x} + 1} + x + C.$$
Multiplying the second term by \( \frac{\ln{x} + 1}{\ln{x} + 1} \) gives
$$-\frac{x\ln{x}}{\ln{x} + 1} + \frac{x(\ln{x} + 1)}{\ln{x} + 1} + C.$$
Distributing, we arrive at
$$-\frac{x\ln{x}}{\ln{x} + 1} + \frac{x\ln{x} + x}{\ln{x} + 1} + C.$$
Adding, we get a final answer of
$$\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 we can still compute the integrals. Part a gives an example where we can algebraically solve for the integral, while part b involves a cancellation.
Example 6: Evaluate:
(a) \( \int e^x\sin{x} dx \)
(b) \( \int \frac{\ln{x} – 1}{\ln^2{x}} dx \)
Solution: (a) \( \int e^x\sin{x} dx \)
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$$
Substituting in I for the remaining integral, we find
$$I = \sin{x} e^x – \cos{x}e^x – I.$$
Adding I to both sides of the equation, we get
$$2I = \sin{x} e^x – \cos{x}e^x + C$$
Finally, dividing both sides by 2, we arrive at a final answer of
$$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 \)
First, we show that \(- \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.$$
Which is equivalent to
$$- \int u ^{-2} du.$$
Integrating, we arrive at
$$u^{-1},$$
In terms of positive exponents, this is
$$\frac{1}{u},$$
Back substitution gives
$$\frac{1}{\ln{x}}.$$
We now solve the original integral. To start, 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}{\ln{x}} dx.$$
Cancelling the integrals gives a final answer of
$$\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 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
$$x e^x |_0^1 – \int_0^1 e^x dx.$$
By the Fundamental Theorem of Calculus, we have
$$1e^1 – 0e^0 – \int_0^1 e^x dx.$$
This evaluates to
$$e – \int_0^1 e^x dx.$$
Integrating gives
$$e – e^x |_0^1.$$
Applying the Fundamental Theorem of Calculus, we obtain
$$e – (e^1 – e^0).$$
This evaluates to
$$e – (e – 1).$$
Subtracting gives a final answer of
$$1.$$
Conclusion
In this guide, you saw integration by parts explained with examples. 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.
Further Reading
How to Integrate Products of Trigonometric Functions: Techniques and Tricks – Now that you know integration by parts, you are able to integrate some of the more challenging products of trigonometric functions.

