Integration by Parts

\(\int\ u \frac{dv}{dx}= uv- \int\ v \frac{du}{dx} \)


Examples

Find   \( \int\ x\ sinx\ dx \)

\begin{align} Let \quad I & = \int\ x\ sinx \ dx \\ \\ And\ let \quad u & = x \\ \implies\ \frac{du}{dx} & = 1 \\ \\ Then \quad \frac{dv}{dx} & = sinx \\ \implies\ v & = -cosx \\ \\ Applying\ the\ formula \\ \\ I & = -x\ cosx - \int\ -cosx\ \times 1\ dx \\ \\ & = -x\ cosx +sinx +c \end{align}



Find   \( \int\ x^2\ e^x\ dx \)

\begin{align} Let \quad I & = \int\ x^2\ e^x\ dx \\ \\ And\ let \quad u & = x^2 \\ \implies\ \frac{du}{dx} & = 2x \\ \\ Then \quad \frac{dv}{dx} & = e^x \\ \implies\ v & = e^x \\ \\ Applying\ the\ formula \\ \\ I & = x^2\ e^x - \int\ e^x\ \times 2x\ dx \\ \\ Applying\ the\ formula\ & again\ to\ the\ integral\ in\ the\ RHS \\ \\ I & = x^2\ e^x-\left(2xe^x- \int\ 2e^x\ dx \right) \\ \\ & = x^2\ e^x -2x\ e^x+2e^x+c\\ \end{align}