# Integration by Parts in Calculus

   

Examples with detailed solutions and exercises with answers on how to use the technique of integration by parts to find integrals are presented.

## Review Integration by Parts

The method of integration by parts may be used to easily integrate products of functions. The main idea of integration by parts starts the derivative of the product of two function $$u$$ and $$v$$ as given by $\dfrac{d(u \cdot v)}{dx} = \dfrac{du}{dx} v + u \dfrac{dv}{dx}$ Rewrite the above as $u \dfrac{dv}{dx} = \dfrac{d(u \cdot v)}{dx} - \dfrac{du}{dx} v$ Take the integral of both side of the above equation follows $\int u \; \dfrac{dv}{dx}\; dx = \int \dfrac{d(u \cdot v)}{dx} \; dx - \int \dfrac{du}{dx} \; v \; dx$ Noting that $$\displaystyle \int \dfrac{d(u \cdot v)}{dx} \; dx = u v$$, the above is simplified to obtain the rule of integration by parts. $\boxed {\int u \; \dfrac{dv}{dx}\; dx = u \; v - \int \dfrac{du}{dx} \; v \; dx}$ Note that any choice of which function in the integral on the left is chosen as $$u$$ and which is chosen as $$\dfrac{dv}{dx}$$ must simplify the integral on the right of the above formula.

## Examples with Detailed Solutions

In what follows $$c$$ is a constant of integration.

### Example 1

Evaluate the integral $\int 3 x e^x \; dx$ Solution to Example 1
$$3$$ is a constant and may therefore be taken out of the integrand outside the inetgral sign.
Let $$u = x$$ and $$\dfrac{dv}{dx} = e^x$$ , hence $$\dfrac{du}{dx} = 1$$ and $$v = \displaystyle \int e^x \; dx = e^x$$ and using the method of integration by parts, we have
\begin{aligned} & \color{red}{\text{given integral}} \\[8pt] & \int 3 \; x \; e^x \; dx \\[15pt] & \color{red}{\text{constant $$3$$ out of integral}} \\[8pt] & = 3 \int x \; e^x \; dx \\[15pt] &\color{red}{\text{apply integration by parts}}\\[8pt] & = 3 \left( x \; e^x - \int 1 \cdot e^x \; dx \right) \\[15pt] &\color{red}{\text{evaluate integral and simplify to obtain the final answer}} \\[8pt] & \int 3 x e^x \; dx = 3 \; x \; e^x - 3 \; e^x + c \end{aligned}

### Example 2

Evaluate the integral $\int x \; \sin(x) \; dx$ Solution to Example 2
Let $$u = x$$ and $$\dfrac{dv}{dx} = \sin(x)$$, hence $$\dfrac{du}{dx} = 1$$ and $$v = - \cos(x)$$. Hence \begin{aligned} & \color{red}{\text{given integral}} \\[8pt] & \int x \; \sin(x) \; dx \\[15pt] &\color{red}{\text{integration by parts}}\\[8pt] & = x (-\cos(x)) - \int 1 \cdot (-cos(x)) \; dx \\[15pt] &\color{red}{\text{evaluate integral and simplify obtain the final answer}} \\[8pt] & \int x \; \sin(x) \; dx = - x \cos(x) + \sin(x) + c \end{aligned}

### Example 3

Calculate the integral $\int x^2 \; \cos x \; dx$ Solution to Example 3
Let $$u = x^2$$ and $$\dfrac{dv}{dx} = \cos(x)$$, hence $$\dfrac{du}{dx} = 2x$$ and $$v = sin(x)$$ and apply the integration by parts. $\int \; x^2 \cos(x) \; dx = x^2 \sin (x) - 2 \int x\; \sin (x) \; dx \qquad (I)$ We now need to apply the method of integration by parts to the integral $$\displaystyle \int x\; \sin (x) \; dx$$ . In example 2 we evaluated the integral $$\displaystyle \int x\; \sin (x) \; dx = - x \cos(x) + \sin(x)$$ and we may substitute this in the above integral. Hence the final result is given by \begin{aligned} & \color{red}{\text{right side of (I) above}} \\[8pt] & x^2 \sin (x) - 2 \int x\; \sin (x) \; dx \\[15pt] &\color{red}{\text{substitute integral on the right of (I)}} \\[8pt] & = x^2 \sin(x) - 2 (- x \cos(x) + \sin(x)) + c \\[15pt] &\color{red}{\text{simplify to obtain the final answer}} \\[8pt] & \int x^2 \; \cos x \; dx = x^2 \sin(x) + 2 x \cos(x) - 2 \sin(x) + c \end{aligned}

### Example 4

Evaluate the integral $\int x \; \ln x \; dx$ Solution to Example 4:
Let $$u = \ln(x)$$ and $$\dfrac{dv}{dx} = x$$ , hence $$\dfrac{du}{dx} = \dfrac{1}{x}$$and $$v = \dfrac{x^2}{2}$$ and apply the integration by parts. \begin{aligned} &\color{red}{\text{Given the integral}} \\[8pt] & \int x^2 \; \ln x \; dx \\[15pt] & \color{red}{\text{integration by parts}} \\[8pt] & = \dfrac{x^2}{2} \; \ln x - \int \dfrac{x^2}{2} \; \dfrac{1}{x} \; dx \\[15pt] &\color{red}{\text{simplify integrand}} \\[8pt] & = \dfrac{x^2}{2} \; \ln x - \int \dfrac{x}{2} \; dx \\[15pt] &\color{red}{\text{evaluate integral to obtain the final answer }} \\[8pt] & \int x^2 \; \ln x \; dx = \dfrac{x^2}{2} \; \ln x - \dfrac{1}{4} \; x^2 + c \end{aligned}

### Example 5

Calculate the integral $\int x \; \cos \left(\dfrac{x}{3} \right) \; dx$ Solution to Example 5:
Let $$u = x$$ and $$\dfrac{dv}{dx} = \cos \left(\dfrac{x}{3} \right)$$, hence $$\dfrac{du}{dx} = 1$$ and $$v = 3 \sin \left(\frac{x}{3}\right)$$ \begin{aligned} &\color{red}{\text{Given the integral}} \\[8pt] & \int x \; \cos \left(\dfrac{x}{3} \right) \; dx \\[15pt] &\color{red}{\text{integration by parts}} \\[8pt] & = x \cdot 3 \sin \left(\dfrac{x}{3}\right) - \int 1 \cdot 3 \sin \left(\dfrac{x}{3}\right) dx \\[15pt] &\color{red}{\text{evaluate integral and simplify to obtain the final answer}} \\[8pt] & \int x \; \cos \left(\dfrac{x}{3} \right) \; dx = 3 x \sin\left(\dfrac{x}{3}\right) + 9 \cos\left(\dfrac{x}{3}\right) + c \end{aligned}

### Example 6

Use integration by parts to evaluate the integral $\int \ln x \; dx$ Solution to Example 6:
We first rewrite the integrand $$\ln(x)$$ as $$1 \cdot ln(x)$$
$\int \ln(x) dx = \int 1 \cdot ln(x) \;dx$
Let $$u = \ln(x)$$ and $$\dfrac{dv}{dx} = 1$$ , hence $$\dfrac{du}{dx} = \dfrac {1}{x}$$ and $$v = x$$. Using integration by parts, we obtain \begin{aligned} & \int 1 \cdot \ln(x) \;dx = x \ln(x) - \int x \cdot (1/x) dx \\[15pt] &\color{red}{\text{simplify the integrand on the right side}} \\[8pt] & = x \ln(x) - \int 1 \cdot dx \\[15pt] &\color{red}{\text{evaluate integral and simplify to obtain the final answer}} \\[8pt] & \int \ln(x) \; dx = x \ln(x) - x + c \end{aligned}

### Example 7

Use integration by parts to evaluate the integral $\int x^2 \; (\ln x)^2 \; dx$ Solution to Example 7:
Let $$\dfrac{dv}{dx} = x^2$$ and $$u = (ln(x))^2$$ hence $$v = \dfrac{x^3}{3}$$ and $$\dfrac{du}{dx} = 2 \dfrac{\ln x}{x}$$ and use integration by parts to write \begin{aligned} & \int x^2 \; (\ln x)^2 \; dx = \dfrac{x^3}{3} \; (\ln(x))^2 - \int \dfrac{x^3}{3} \left( 2 \dfrac{\ln x}{x} \right) dx \\[15pt] &\color{red}{\text{simplify the integrand on the right}} \\[8pt] & = \dfrac{x^3}{3} \; (\ln(x))^2 - \dfrac{2}{3} \int x^2 \; \ln x \; dx \\[15pt] & \color{red}{\text{Let $$\dfrac{dw}{dx} = x^2$$ and $$z = \ln(x)$$ hence $$w = \dfrac{x^3}{3}$$ and $$z' = \dfrac{1}{x}$$ and use the }} \\[8pt] & \color{red}{\text{ integration by parts one more time on the integral on the right}} \\[8pt] &= \dfrac{x^3}{3} (\ln(x))^2 - \dfrac{2}{3} \left(\dfrac{x^3}{3} \ln(x) - \int \dfrac{x^3}{3} \dfrac{1}{x} \; dx \right) \\[15pt] & \color{red}{\text{simplify the integrand on the right}} \\[8pt] &= \dfrac{x^3}{3} (\ln(x))^2 - \dfrac{2}{3} \left(\dfrac{x^3}{3} \ln(x) - \dfrac{1}{3} \int x^2 \; dx \right) \\[15pt] & \color{red}{\text{Expand and simplify}} \\[8pt] &= \dfrac{x^3}{3} (\ln(x))^2 - \dfrac{2}{9} x^3 \ln(x) + \dfrac{2}{9} \int x^2 \; dx \\[15pt] & \color{red}{\text{Integrate on the right to obtain the final answer}} \\[8pt] & \int x^2 \; (\ln x)^2 \; dx = (\ln(x))^2 \dfrac{x^3}{3} - \dfrac{2}{9}x^3 \ln(x) + \dfrac{2}{27} x^3 + c \\[15pt] \end{aligned}

### Example 8

Use integration by parts to evaluate the integral $\int e^x \sin (2x) dx$ Solution to Example 8:
Let $$I = \int e^x \sin (2x) \; dx$$ which is the integral to evaluate.
Let $$v = \sin(2x)$$ and $$\dfrac{du}{dx} = e^x$$ hence $$\dfrac{dv}{dx} = 2 \cos(2x)$$ and $$u = e^x$$.
Use integration by parts as follows
\begin{aligned} & \int e^x \sin(2x) dx = e^x \sin(2x) - \int e^x \cdot 2 \cos(2x) dx \\[15pt] & \color{red}{\text{Take the constant $$2$$ out of the integral sign and rewrite as}} \\[8pt] & = e^x \sin(2x) - 2 \int e^x \cdot \cos(2x) dx \\[15pt] & \color{red}{\text{We now let $$w = \cos(2x)$$ and $$\dfrac{dz}{dx} = e^x$$ hence $$w'= -2 \sin(2x)$$ and $$z = e^x$$ and }} \\[8pt] & \color{red}{\text{use the integration by parts one more time to the integral on the right}}\\[8pt] & = e^x \sin(2x) - 2 \left(e^x \cdot \cos(2x) - \left(\int e^x \cdot (-2 \sin(2x)) dx \right)\right) \\[15pt] & \color{red}{\text{Expand and simplify}} \\[8pt] & = e^x \sin(2x) - 2 e^x \cdot \cos(2x) - 4 \left(\int e^x \cdot \sin (2x) \right) dx \\[15pt] & \color{red}{\text{Note that the integral on the right is the intergal $$I = \int e^x \cdot \sin (2x) dx$$}}\\[8pt] & \color{red}{\text{we are trying to evaluate , hence the above may be written as}}\\[8pt] & I = e^x \sin(2x) - 2 e^x \cdot \cos(2x) - 4 I \\[15pt] & \color{red}{\text{Solve the last equation for $$I$$ to obtain the final answer}} \\[8pt] & I = \int e^x \cdot \sin (2x) dx = \dfrac{e^x \sin(2x) - 2e^x \cos(2x)}{5} + c \end{aligned}

## Exercises

Use the table of integrals and the method of integration by parts to find the integrals below. [Note that you may need to use the method of integration by parts more than once].
1. $$\displaystyle \int x \; \cos(x) \; dx$$

2. $$\displaystyle \int x \; e^{2x} \; dx$$

3. $$\displaystyle \int x^{1/3} \; \ln x \; dx$$

4. $$\displaystyle \int \dfrac{\ln x}{x^2} \; dx$$

5. $$\displaystyle \int x^3 \; \cos x \; dx$$

6. $$\displaystyle \int x^2 \; e^{-3x} \; dx$$

7. $$\displaystyle \int e^x \; \cos(2 x) \; dx$$

1. $$x \sin(x) + \cos(x) + c$$

2. $$\dfrac{x}{2} e^{2x} - \dfrac{1}{4} e^{2x} + c$$

3. $$\dfrac{3}{4} x^{\frac{4}{3}} \ln(x) - \dfrac{9}{16} x^{\frac{4}{3}} + c$$

4. $$- \dfrac{\ln x}{x} - \dfrac{1}{x} + c$$

5. $$3(x^2 - 2) \cos(x) + (x^3 - 6 x) \sin(x) + c$$

6. $$- \dfrac{1}{27} ( 9 x^2 + 6 x + 2 ) e^{-3x} + c$$

7. $$\dfrac{1}{5} ( e^x \cos(2x) + 2 e^x \sin(2x) ) + c$$