By Parts By Parts

Introduction

Integration by Parts is the reverse of the product rule:

\begin{align*} \frac{d}{dx}[fg] &= fg' + f'g \\ \text{} \\ \frac{d}{dx}[fg] - f'g &= fg' \\ \text{} \\ \int \frac{d}{dx}[fg] dx - \int f'g dx &= \int fg' dx \\ \text{} \\ fg - \int f'g dx &= \int fg' dx \end{align*}
Here is an example of applying Integration by Parts:
\int x e^x dx \\ \text{} \\ f(x) = x \quad g'(x) = e^x \\ \text{} \\ f'(x) = 1 \quad g(x) = e^x \\ \text{} \\ \begin{align*} \int fg' \,dx &= fg - \int f'g \,dx \\ \text{} \\ \int xe^x \,dx &= xe^x - \int e^x \,dx \\ \text{} \\ &= xe^x - e^x + C \\ \text{} \\ &= e^x(x - 1) + C \end{align*}

Integrating arctan

\int \arctan(x) \,dx \\ \text{} \\ f(x) = \arctan(x) \quad g'(x) = 1 \\ \text{} \\ f'(x) = \frac{1}{1 + x^2} \quad g(x) = x \\ \text{} \\ \begin{align*} \int fg' \,dx &= fg - \int f'g \,dx \\ \text{} \\ \int \arctan(x) \,dx &= x\arctan(x) - \int \frac{x \, dx}{1+x^2} \\ \text{} \\ u = 1 + x^2 &\quad \frac{1}{2}du = x \, dx \\ \text{} \\ \int \arctan(x) \,dx &= x\arctan(x) - \int \frac{du}{2u} \\ \text{} \\ &= x\arctan(x) - \frac{1}{2}\ln|u| + C \\ \text{} \\ &= x\arctan(x) - \frac{1}{2}\ln|1 + x^2| + C \end{align*}

Integrating xsin

\int x\sin(x) \,dx \\ \text{} \\ f(x) = x \quad g'(x) = \sin(x) \\ \text{} \\ f'(x) = 1 \quad g(x) = -\cos(x) \\ \text{} \\ \begin{align*} \int fg' \,dx &= fg - \int f'g \,dx \\ \text{} \\ \int x\sin(x) \,dx &= -x\cos(x) - \int -\cos(x) \,dx \\ \text{} \\ &= -x\cos(x) + \sin(x) + C \end{align*}