Let $$u$$ and $$v$$ be differentiable functions of $$x$$. Then the differential of the product $$uv$$ is found by the product rule

$$d(uv)=udv+vdu$$

Whence, by integration, we have

$$uv=\int{udv}+\int{vdu}$$

Re-arranging leads to the formula

$$\bbox[5pt, border:2px solid blue] { \int{udv}=uv-\int{vdu}\qquad{ (1) } }$$

This formula is called integration by parts. It is often used to integrate expressions, that may be represented as a product of two factors $$u$$ and $$dv$$, in such a way that the finding of the function $$v$$ from its differential $$dv$$ and the evaluation of the integral $$\int{vdu}$$ taken together, be a simpler problem than the direct evaluation of the integral $$\int{udv}$$. To become skilled at breaking up a given element of integration into factors $$u$$ and $$dv$$, one has to solve problems.

Example 1. \begin{aligned} \int{x\sin {x}dx} \end{aligned}

Solution. Let $$u=x$$ and $$dv=\sin {x}$$. Then, $$du=1$$ and $$v=-\cos {x}$$.

\begin{aligned} I&=-x\cos {x}+\int{\cos {x}dx}\\ &=-x\cos {x}+\sin {x}+C\\ \end{aligned}

Example 2. \begin{aligned} \int{x\cos {x}dx} \end{aligned}

Solution. Let $$u=x$$ and $$dv=\cos {x}$$. Then, $$du=1$$ and $$v=\sin {x}$$.

\begin{aligned} I&=x\sin {x}-\int{\sin {x}dx}\\ &=x\sin {x}+\cos {x}+C\\ \end{aligned}

The rule of integration by parts is widely used. For example, integrals of the form

$$\int{x^{k}\sin {ax}}, \int{x^{k}\cos {ax}}$$

$$\int{x^{k}e^{ax}}, \int{x^{k}\ln{ax}}$$

and certain integrals containing inverse trignometric functions are evaluated by means of integration by parts.

Example 3. \begin{aligned} \int{x^{3}\sin {x}dx} \end{aligned}

Solution. In the table below, the first column represents $$x^{3}$$ and its derivatives and the second column represents $$\sin {x}$$ and its integrals.

$$\begin{array}{ccc} x^{3} & & \sin x \\ \hline \\ 3x^{2} & & -\cos x \\ & + &\\ 6x & & -\sin x \\ & – &\\ 6 & & \cos x \\ & + &\\ 0 & & \sin x \end{array}$$

This table shows the repeated application of integration by parts. Following the table, the final answer is given by:

\begin{aligned} I = -3x^{2}\sin x -6x\cos x + 6\sin x \end{aligned}

Example 4. \begin{aligned} \int{x^{4}\cos {x}dx} \end{aligned}

Solution. In the table below, the first column represents $$x^{4}$$ and its derivatives and the second column represents $$\cos {x}$$ and its integrals.

$$\begin{array}{ccc} x^{4} & & \cos x \\ \hline \\ 4x^{3} & & \sin x \\ & + &\\ 12x^{2} & & -\cos x \\ & – &\\ 24x & & -\sin x \\ & + &\\ 24 & & \cos x\\ & – &\\ 0 & & \sin x\\ \end{array}$$

Following the table, the final answer is given by:

\begin{aligned} I = -4x^{3}\cos x +12x^{2}\sin x + 24\cos x – 24\sin x \end{aligned}

Example 5. \begin{aligned} \int{x^{2}e^{x}dx} \end{aligned}

Solution. In the table below, the first column represents $$x^{2}$$ and its derivatives and the second column represents $$e^{x}$$ and its integrals.

$$\begin{array}{ccc} x^{2} & & e^{x} \\ \hline \\ 2x & & e^{x} \\ & + &\\ 2 & & e^{x} \\ & – &\\ 0 & & e^{x} \end{array}$$

Following the table, the final answer is given by:

\begin{aligned} I = 2xe^{x}-2e^{x} \end{aligned}

Example 6. \begin{aligned} \int{x^{n}\ln^{x}dx} \end{aligned}

Solution. Let $$u=\ln x$$ and $$dv=x^{n}$$. Then, $$du=\frac{1}{x}$$ and $$v=\frac{x^{n+1}}{n+1}$$.

\begin{aligned} I&=\ln x\cdot\frac{x^{n+1}}{n+1}-\frac{1}{n+1}\int{x^{n}dx}\\ &=\ln x\cdot\frac{x^{n+1}}{n+1}-\frac{x^{n+1}}{(n+1)^{2}}+C\\ \end{aligned}

Example 7. \begin{aligned} \int{\arcsin x dx} \end{aligned}

Solution. Let $$u=\arcsin x$$ and $$dv=1$$. Then, $$du=\frac{1}{\sqrt{1-x^{2}}}$$ and $$v=x$$.

\begin{aligned} I&=x\arcsin {x} – \int{\frac{x}{\sqrt{1-x^{2}}}dx}\\ &=x\arcsin x + \sqrt{1-x^{2}}+C\\ \end{aligned}

Example 7. \begin{aligned} \int{\arccos x dx} \end{aligned}

Solution. Let $$u=\arccos x$$ and $$dv=1$$. Then, $$du=-\frac{1}{\sqrt{1-x^{2}}}$$ and $$v=x$$.

\begin{aligned} I&=x\arccos {x} + \int{\frac{x}{\sqrt{1-x^{2}}}dx}\\ &=x\arccos {x} – \sqrt{1-x^{2}}+C\\ \end{aligned}

Example 8. \begin{aligned} \int{\arctan x dx} \end{aligned}

Solution. Let $$u=\arctan x$$ and $$dv=1$$. Then, $$du=\frac{1}{1+x^{2}}$$ and $$v=x$$.

\begin{aligned} I&=x\arctan {x} – \int{\frac{x}{1+x^{2}}dx}\\ &=x\arctan {x} – \sqrt{1+x^{2}}+C\\ \end{aligned}

Example 9. \begin{aligned} \int{\ln x dx} \end{aligned}

Solution. Let $$u=\ln x$$ and $$dv=1$$. Then, $$du=\frac{1}{x}$$ and $$v=x$$.

\begin{aligned} I&=x\ln{x} – \int{dx}\\ &=x\ln{x} – x + C \end{aligned}

Example 10. \begin{aligned} \int{\ln (1-x) dx} \end{aligned}

Solution. Let $$u=\ln (1-x)$$ and $$dv=1$$. Then, $$du=-\frac{1}{1-x}$$ and $$v=x$$.

\begin{aligned} I&=x\ln{(1-x)} + \int{\frac{xdx}{1-x}}\\ &=x\ln{(1-x)} – \int{\frac{(1-x-1)dx}{(1-x)}}\\ &=x\ln{(1-x)} – \int{dx} + \int{\frac{dx}{1-x}}\\ &=x\ln{(1-x)} – x – \ln(1-x)\\ \end{aligned}

Example 11. \begin{aligned} \int{\frac{x^{2}}{\sqrt{1-x^{2}}} dx} \end{aligned}

Solution. Let $$u=x$$ and $$dv=\frac{x}{\sqrt{1-x^{2}}}$$. Then, $$du=1$$ and $$v=-\sqrt{1-x^{2}}$$.

\begin{aligned} I&=-x\sqrt{1-x^{2}} + \int{\sqrt{1-x^{2}}dx}\\ &=-x\sqrt{1-x^{2}} + \int{\sqrt{1-x^{2}}\cdot\frac{\sqrt{1-x^{2}}}{\sqrt{1-x^{2}}}dx}\\ &=-x\sqrt{1-x^{2}} + \int{\frac{1-x^{2}}{\sqrt{1-x^{2}}}dx}\\ &=-x\sqrt{1-x^{2}} + \int{\frac{dx}{\sqrt{1-x^{2}}}} – \int{\frac{x^{2}dx}{\sqrt{1-x^{2}}}}\\ &=-x\sqrt{1-x^{2}} + \arcsin {x} – I\\ 2I&=-x\sqrt{1-x^{2}} + \arcsin {x}\\ I&=-\frac{x}{2}\sqrt{1-x^{2}} + \frac{1}{2}\arcsin {x} \end{aligned}

Example 12. \begin{aligned} \int{\sqrt{r^{2}-x^{2}} dx} \end{aligned}

Solution. We multiply the numerator and denominator by $$\sqrt{r^{2}-x^{2}}$$. Consequently, we have :

\begin{aligned} I&=\int{\sqrt{r^{2}-x^{2}}\times\frac{\sqrt{r^{2}-x^{2}}}{\sqrt{r^{2}-x^{2}}}dx}\\ &=\int{\frac{r^{2}-x^{2}}{\sqrt{r^{2}-x^{2}}}dx}\\ &=r^{2}\int{\frac{dx}{\sqrt{r^{2}-x^{2}}}}-\int{\frac{x^{2}dx}{\sqrt{r^{2}-x^{2}}}}\\ &=r^{2}\arcsin {x} – \int{\frac{x^{2}dx}{\sqrt{r^{2}-x^{2}}}}\\ \end{aligned}

In the latter integral, let $$u=x$$ and $$dv=\frac{xdx}{\sqrt{r^{2}-x^{2}}}$$. Then, $$du=1$$ and $$v=-\sqrt{r^{2}-x^{2}}$$. Therefore, we have

\begin{aligned} I&=r^{2}\arcsin {x} – \int{x\cdot\frac{x}{\sqrt{r^{2}-x^{2}}}dx}\\ &=r^{2}\arcsin {x} + x\sqrt{r^{2}-x^{2}}- \int{\sqrt{r^{2}-x^{2}}dx}\\ &=r^{2}\arcsin {x} + x\sqrt{r^{2}-x^{2}} – I\\ 2I&=r^{2}\arcsin {x} + x\sqrt{r^{2}-x^{2}}\\ I&=\frac{r^{2}}{2}\arcsin {x}+\frac{x}{2}\sqrt{r^{2}-x^{2}}+C \end{aligned}

Example 13. \begin{aligned} \int{x \arcsin {x} dx} \end{aligned}

Solution. Let $$u=\arcsin {x}$$ and $$dv=x$$. Then, $$du=\frac{1}{\sqrt{1-x^{2}}}$$ and $$v=\frac{x^{2}}{2}$$.

\begin{aligned} I&=\frac{x^{2}}{2}\arcsin {x}-\frac{1}{2}\left[\int{\frac{x^{2}dx}{\sqrt{1-x^{2}}}}\right]\\ &=\frac{x^{2}}{2}\arcsin {x}-\frac{1}{2}I_{1}\\ \end{aligned}

In the latter integral $$I_{1}$$, we let $$u=x$$ and $$dv=\frac{xdx}{\sqrt{1-x^{2}}}$$. Then, $$du=1$$ and $$v=-\sqrt{1-x^{2}}$$. Consequently, we have

\begin{aligned} I_{1}&=\int{x\cdot\frac{xdx}{\sqrt{1-x^{2}}}}\\ &=-x\sqrt{1-x^{2}}+\int{\sqrt{1-x^{2}}dx}\\ &=-x\sqrt{1-x^{2}}+\int{\sqrt{1-x^{2}}\times\frac{\sqrt{1-x^{2}}}{\sqrt{1-x^{2}}}dx}\\ &=-x\sqrt{1-x^{2}}+\int{\frac{1-x^{2}}{\sqrt{1-x^{2}}}dx}\\ &=-x\sqrt{1-x^{2}}+\int{\frac{dx}{\sqrt{1-x^{2}}}}-\int{\frac{x^{2}}{\sqrt{1-x^{2}}}}\\ &=-x\sqrt{1-x^{2}}+\arcsin {x} – I_{1}\\ 2I_{1}&=-x\sqrt{1-x^{2}}+\arcsin {x}\\ I_{1}&=-\frac{x}{2}\sqrt{1-x^{2}}+\frac{1}{2}\arcsin {x}+C \end{aligned}

The final answer is given by,

\begin{aligned} I&=\frac{x^{2}}{2}\arcsin {x}-\frac{1}{2}\left[-\frac{x}{2}\sqrt{1-x^{2}}+\frac{1}{2}\arcsin {x}\right]+C\\ &=\frac{x^{2}}{2}\arcsin {x}+\frac{x}{4}\sqrt{1-x^{2}}-\frac{1}{4}\arcsin {x}+C\\ \end{aligned}