# Integration by Parts – An Ultimate Guide

Integration by parts is a technique for evaluating definite integrals or indefinite integrals.

This process is often called Partial Integration and is a process that finds the integral of a product of functions in terms of the integral of the product of their derivative and antiderivative.

It is based on the formula:

\large \displaystyle \begin{align} \int uv^{\prime} = & \ uv-\int u^{\prime}v \\ &\text{or} \\ \int u^{\prime}v = & \ uv-\int uv^{\prime} \end{align}

This formula allows us to rewrite the integral of the product of two functions as the product of the two functions minus the integral of the product of their derivatives.

Here’s an example of how to use the formula to evaluate an integral:

$\displaystyle \int x \sin x dx$

We can choose:

$\begin{array}{ll} u=x, & v^{\prime}=\sin x \\ u^{\prime}=1, & v=-\cos x \end{array}$

Substituting these values into the formula, we get:

\begin {align} \displaystyle \int x \sin x dx &= x (-\cos x)-\int (-\cos x) dx \\ &= -x\cos x+\int \cos x dx \end{align}

The second integral on the right-hand side is easy to evaluate since it is a standard integral:

$\displaystyle \int \cos x dx = \sin x + C$

Substituting this back into the original equation, we get:

$\displaystyle \int x \sin x dx = -x \cos x+\sin x + C$

And that’s it! We’ve successfully evaluated the integral using integration by parts.

## Example 1 – Integration by Parts of Trigonometric Functions

(a)     Find $\displaystyle \int x \cos x dx$.

\begin{align} \displaystyle \require{AMSsymbols} &\color{green}{u = x, v^{\prime}=\cos x} \\ &\color{green}{u^{\prime}=1, v=\sin x} \\ \int x \cos x dx &= x \sin x-\int1 \times \sin x dx \\ &= x \sin x + \cos x +C \end{align}

(b)     Hence, find $\displaystyle \int x^2 \sin x dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u = x^2, v^{\prime}= \sin x} \\ &\color{green}{u^{\prime}= 2x, v=-\cos x} \\ \int x^2 \sin x dx &= x^2(-\cos x)-\int 2x(-\cos x) dx \\ &= -x^2 \cos x+2\int x \cos x dx \\ &= -x^2 \cos x + 2 (x \sin x + \cos x) +C &\color{green}{\text{by (a)}} \end{align}

## Example 2 – Integration by Parts using Double Angle Formulae

Prove $\displaystyle \int \left( \cos^4 x-\sin^4 x \right) dx = \frac{1}{4} \sin^3 x \cos x-\frac{3}{32} \sin 4x + \frac{3}{16} \sin 2x + \cos^3 x \sin x + C$.

\require{AMSsymbols} \displaystyle \begin{align} \int \cos^4 x dx &= \int \cos^3 x \cos x dx \\ &\color{green}{u=\cos^3 x, v^{\prime}=\cos x} \\ &\color{green}{u^{\prime}=\cos^3 x \sin x, v=\sin x} \\ &= \cos^3 x \sin x-\int-3 \cos^2 x \sin^2 x dx &\color{green}{\int uv^{\prime} = uv-\int u^{\prime}v} \\ &= \cos^3 x \sin x + 3\int \cos^2 x \sin^2 x dx \\ &= \cos^3 x \sin x + 3\int \left(\cos x \sin x \right)^2 dx \\ &= \cos^3 x \sin x + 3\int \left( \frac{\sin 2x}{2} \right)^2 dx &\color{green}{\sin 2x = 2 \cos x \sin x} \\ &= \cos^3 x \sin x + \frac{3}{4} \int \sin^2 2x dx \\ &= \cos^3 x \sin x + \frac{3}{4} \int \frac{1-\cos 4x}{2} dx &\color{green}{\cos 4x = 1-2 \sin^2 x} \\ &= \cos^3 x \sin x + \frac{3}{8} \int \left(1-\cos 4x \right) dx \\ &= \cos^3 x \sin x + \frac{3}{8} \left(x-\frac{\sin 4x}{4} \right)+C_1 \\ &= \cos^3 x \sin x + \frac{3x}{8}-\frac{3}{32} \sin 4x+C_1 \color{green}{\cdots (1)} \\ \int \sin^4 x dx &= \int \sin^3 x \sin x dx \\ &\color{green}{u=\sin^3 x, v^{\prime}= \sin x} \\ &\color{green}{u^{\prime}=3 \sin^2 x \cos x, v=-\cos x} \\ &= \sin^3 x (-\cos x)-\int 3 \sin^2 x \cos x (-\cos x)dx &\color{green}{\int uv^{\prime}=uv-\int u^{\prime}v} \\ &= -\sin^3 x \cos x+3\int \sin^2 x \cos^2 x dx \\ &= -\sin^3 x \cos x+3\int \sin^2 x (1-\sin^2 x) dx \\ \int \sin^4 x dx &= -\sin^3 x \cos x+3\int \sin^2 x dx-3 \int \sin^4 x dx \\ \int \sin^4 x dx + 3\int \sin^4 x dx &= -\sin^3 x \cos x+3\int \sin^2 x dx \\ 4\int \sin^4 x dx &= -\sin^3 x \cos x+3\int \frac{1-\cos 2x}{2} dx &\color{green}{\cos 2x = 1-2 \sin^2 x} \\ &= -\sin^3 x \cos x+\frac{3}{2}\int \left( 1-\cos 2x \right) dx \\ &= -\sin^3 x \cos x+\frac{3}{2} \left( x-\frac{\sin 2x}{2} \right)+C_2 \\ &= -\sin^3 x \cos x+\frac{3x}{2}-\frac{3}{4} \sin 2x +C_2 \\ \int \sin^4 x dx &= -\frac{1}{4}\sin^3 x \cos x+\frac{3x}{8}-\frac{3}{16} \sin 2x + C_2 \color{green}{\cdots (2)} \\ \int \left( \cos^4 x-\sin^4 x \right) dx &= \int \cos^4 x dx-\int \sin^4 x dx &\color{green}{\text{by (1) and (2)}} \\ &= \left( \cos^3 x \sin x + \frac{3x}{8}-\frac{3}{32} \sin 4x +C_1 \right)-\left(-\frac{1}{4}\sin^3 x \cos x+\frac{3x}{8}-\frac{3}{16} \sin 2x+ C_2 \right) \\ \therefore \int \left( \cos^4 x-\sin^4 x \right) dx &= \frac{1}{4} \sin^3 x \cos x-\frac{3}{32} \sin 4x + \frac{3}{16} \sin 2x + \cos^3 x \sin x + C &\color{green}{C=C_1-C_2} \end{align}

## Example 3 – Integration by Parts of Exponential Functions

(a)     Find $\displaystyle \int y e^y dy$.

\begin{align} \displaystyle \require{AMSsymbols} &\color{green}{u = y, v^{\prime}=e^y} \\ &\color{green}{u^{\prime}=1, v=e^y} \\ \int y e^y dy &= y e^y-\int e^y dy \\ &= y e^y-e^y +C \end{align}

(b)     Find $\displaystyle \int x^3 e^{x^2} dx$.

\begin{align} \displaystyle \require{AMSsymbols} \text{Let } y &= x^2 \\ \frac{dy}{dx} &= 2x \\ dx &= \frac{dy}{2x} \\ \int x^3 e^{x^2} dx &= \int x^3 e^y \frac{dy}{2x} \\ &= \frac{1}{2} \int x^2 e^y dy \\ &= \frac{1}{2} \int y e^y dy \\ &= \frac{1}{2} \left(y e^y-e^y \right) +C &\color{green}{\text{by (a)}} \\ &= \frac{1}{2} \left( x^2 e^{x^2}-e^{x^2} \right)+C \end{align}

## Example 4 – Integration by Parts of Natural Logarithmic Functions

(a)     Find $\displaystyle \int \ln x dx$.

\begin{align} \displaystyle \require{AMSsymbols} &\color{green}{u = \ln x, v^{\prime}=1} \\ &\color{green}{u^{\prime}=\frac{1}{x}, v=x} \\ \int \ln x dx &= \int \ln x \times 1 dx \\ &= \left( \ln x \right) x-\int \frac{1}{x} \times x dx \\ &= x \ln x-\int 1 dx \\ &= x \ln x-x +C \end{align}

(b)     Hence, find $\displaystyle \int (\ln x)^2 dx$.

\begin{align} \displaystyle \require{AMSsymbols} &\color{green}{u = (\ln x)^2, v^{\prime}=1} \\ &\color{green}{u^{\prime}=2 (\ln x) \frac{1}{x}, v=x} \\ \int (\ln x)^2 dx &= \int (\ln x)^2 \times 1 dx \\ &= (\ln x)^2 x-\int 2(\ln x) \frac{1}{x} \times x dx +C \\ &= x (\ln x)^2-2\int \ln x dx +C \\ &= x (\ln x)^2-2 (x \ln x-x)+C &\color{green}{\text{by (a)}} \\ &= x(\ln x)^2-2x \ln x + 2x +C \end{align}

## Example 5 – Integration by Parts of Exponential and Trigonometric Functions

(a)     Prove $\displaystyle \int e^x \cos x dx = e^x \sin x-\int e^x \sin x dx$.

\begin{align} \displaystyle \require{AMSsymbols} &\color{green}{u = e^x, v^{\prime}=\cos x} \\ &\color{green}{u^{\prime}=e^x, v=\sin x} \\ \int e^x \cos x dx &= e^x \sin x-\int e^x \sin x dx \end{align}

(b)     Hence, find $\displaystyle \int e^x \cos x dx$.

\begin{align} \require{AMSsymbols} \displaystyle \int e^x \cos x dx &= e^x \sin x-\int e^x \sin x dx \color{green}{\cdots (1)} \\ &\color{green}{u = e^x, v^{\prime}=\sin x} \\ &\color{green}{u^{\prime}=e^x, v=-\cos x} \\ \int e^x \sin x dx &= e^x (-\cos x)-\int e^x (-\cos x)dx \\ &= -e^x \cos x + \int e^x \cos x dx \\ \color{green}{(1) \cdots} \int e^x \cos x dx &= e^x \sin x-\left(-e^x \cos x + \int e^x \cos x dx\right) \\ &=e^x \sin x + e^x \cos x-\int e^x \cos x dx \\ 2 \int e^x \cos x dx &= e^x \sin x + e^x \cos x \\ \therefore \int e^x \cos x dx &= \frac{e^x \sin x + e^x \cos x}{2} + C \end{align}

(c)     Hence, find $\displaystyle \int e^x \sin x dx$.

\begin{align} \require{AMSsymbols} \displaystyle \int e^x \cos x dx &= e^x \sin x-\int e^x \sin x dx &\color{green}{\text{by (a)}} \\ \int e^x \sin x dx &= e^x \sin x-\int e^x \cos x dx \\ &= e^x \sin x-\frac{e^x \sin x + e^x \cos x}{2} &\color{green}{\text{by (b)}} \\ &= \frac{e^x \sin x-e^x \cos x}{2} +C \end{align}

## Example 6 – Integration by Parts of Quadratic and Trigonometric Functions

Find $\displaystyle \int x^2 \cos x dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u = x^2, v^{\prime}=\cos x} \\ &\color{green}{u^{\prime}=2x, v=\sin x} \\ \int x^2 \cos x dx &= x^2 \sin x-2 \int x \sin x dx \color{green}{\cdots (1)} \\ \int x \sin x dx &= x (-\cos x)-\int 1 \times (-\cos x) dx \\ &= -x \cos x+\int \cos x dx \\ &= -x \cos x + \sin x \\ \color{green}{(1) \cdots} \int x^2 \cos x dx &= x^2 \sin x-2(-x \cos x+\sin x)+C \end{align}

## Example 7 – Integration by Parts of Inverse Sine Functions

(a)     Find $\displaystyle \int \frac{x}{\sqrt{1-x^2}} dx$.

\begin{align} \require{AMSsymbols} \displaystyle \text{Let } u &= 1-x^2 \\ \frac{du}{dx} &=-2x \leadsto \frac{du}{-2x} = dx \\ \int \frac{x}{\sqrt{1-x^2}} dx &= \int \frac{x}{\sqrt{u}} \frac{du}{-2x} \\ &= -\frac{1}{2} \int \frac{1}{\sqrt{u}} du \\ &= -\frac{1}{2} \int u^{-\frac{1}{2}} du \\ &= -\sqrt{u}+C \\ &= -\sqrt{1-x^2}+C \end{align}

(b)     Hence, find $\displaystyle \int \sin^{-1} x dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u^{\prime} = \frac{1}{\sqrt{1-x^2}}, v=x} \\ &\color{green}{u=\sin^{-1} x, v^{\prime}=1} \\ \int \sin^{-1} x dx &= x \sin^{-1} x-\int \frac{x}{\sqrt{1-x^2}} dx \\ &= s \sin^{-1} x-\left(-\sqrt{1-x^2} \right)+C &\color{green}{\text{by (a)}} \\ &= x \sin^{-1} x+\sqrt{1-x^2}+C \end{align}

## Example 8 – Integration by Parts of Inverse Tangent Functions

Find $\displaystyle \int \tan^{-1} x dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u = \tan^{-1} x, v^{\prime}=1} \\ &\color{green}{u^{\prime}=\frac{1}{1+x^2}, v=x} \\ \int \tan^{-1} x dx &= x \tan^{-1} x-\int \frac{x}{1+x^2} dx \\ &= x \tan^{-1} x-\frac{1}{2} \int \frac{2x}{1+x^2} dx \\ &= x \tan^{-1} x-\frac{1}{2} \ln \left|1+x^2 \right| + C \end{align}

## Example 9 – Integration by Parts of Secant Functions

(a)     Prove $\displaystyle \frac{d}{dx} \sec x = \sec x \tan x$.

\begin{align} \require{AMSsymbols} \displaystyle \frac{d}{dx} \sec x &= \frac{d}{dx} (\cos x)^{-1} \\ &= -(\cos x)^{-2} \times \frac{d}{dx} \cos x \\ &= -\sec^2 x \times (-\sin x) \\ &= \frac{1}{\cos^2 x} \times \sin x \\ &= \frac{1}{\cos x} \times \frac{\sin x}{\cos x} \\ &= \sec x \tan x \end{align}

(b)     Prove $\displaystyle \frac{d}{dx} \tan x = \sec^2 x$.

\begin{align} \require{AMSsymbols} \displaystyle \frac{d}{dx} \tan x &= \frac{d}{dx} \frac{\sin x}{\cos x} \\ &= \frac{(\sin x)^{\prime} \cos x-\sin x (\cos x)^{\prime}}{\cos^2 x} \\ &= \frac{\cos x \cos x-\sin x (-\sin x)}{\cos^2 x} \\ &= \frac{\cos^2 x + \sin^2 x}{\cos^2 x} \\ &= \frac{1}{\cos^2 x} \\ &= \sec^2 x \end{align}

(c)     Hence, find $\displaystyle \int \sec x dx$.

\begin{align} \require{AMSsymbols} \displaystyle \int \sec x dx &= \int \frac{\sec x (\sec x + \tan x)}{\sec x +\tan x} dx \\ &= \int \frac{\sec^2 x + \sec x \tan x}{\sec x +\tan x} dx \\ &= \int \frac{(\tan x)^{\prime} + (\sec x)^{\prime}}{\sec x + \tan x} dx \\ &= \int \frac{(\tan x+\sec x)^{\prime}}{\sec x + \tan x} dx \\ &= \ln \left|\sec x + \tan x \right| + C \end{align}

(d)     Hence, find $\displaystyle \int \sec^3 x dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u = \sec x, v^{\prime}=\sec^2 x} \\ &\color{green}{u^{\prime}=\sec x \tan x, v=\tan x} \\ \int \sec^3 x dx &= \sec x \tan x-\int \sec x (\sec^2 x-1) dx \\ &= \sec x \tan x-\int \sec^3 x dx + \int \sec x dx \\ 2\int \sec^3 x dx &= \sec x \tan x + \int \sec x dx \\ &= \sec x \tan x + \ln \left| \sec x + \tan x \right| &\color{green}{\text{by (c)}} \\ \therefore \int \sec^3 x dx &= \frac{1}{2} \sec x \tan x + \frac{1}{2} \ln \left| \sec x + \tan x \right| + C \end{align}

(e)     Find $\displaystyle \int x \sec x \tan x dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u = x, v^{\prime}= \sec x \tan x} \\ &\color{green}{u^{\prime}= 1, v= \sec x} &\color{green}{\text{by (a)}} \\ \int x \sec x \tan x dx &= x \sec x-\int \sec x dx \\ &= x \sec x-\ln \left| \sec x+\tan x \right|+C &\color{green}{\text{by (c)}} \end{align}

(f)     Find $\displaystyle \int \frac{1}{\sqrt{1+x^2}} dx$ by letting $x=\tan \theta$.

\begin{align} \require{AMSsymbols} \displaystyle dx &= \sec^2 \theta d \theta \\ \int \frac{1}{\sqrt{1+x^2}} dx &= \int \frac{1}{\sqrt{1+\tan^2 \theta}} \sec^2 \theta d \theta \\ &= \int \frac{1}{\sqrt{\sec^2 \theta}} \sec^2 \theta d \theta \\ &= \int \frac{1}{\sec \theta} \sec^2 \theta d \theta \\ &= \int \sec \theta d \theta \\ &= \ln \left| \sec \theta + \tan \theta \right| &\color{green}{\text{by (c)}} \\ &= \ln \left| x+\sqrt{1+x^2} \right|+C &\color{green}{\sec \theta = \sqrt{1+\tan^2 \theta} = \sqrt{1+x^2}} \end{align}

(g)     Hence, find $\displaystyle \int \sqrt{1+x^2} dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u = \sqrt{1+x^2}, v^{\prime}= 1} \\ &\color{green}{u^{\prime}= \frac{x}{\sqrt{1+x^2}}, v= x} \\ \int \sqrt{1+x^2} dx &= x \sqrt{1+x^2}-\int \frac{x^2}{\sqrt{1+x^2}} dx \\ &= x \sqrt{1+x^2}-\int \frac{x^2+1-1}{\sqrt{1+x^2}} dx \\ &= x \sqrt{1+x^2}-\int \sqrt{1+x^2} dx + \int \frac{1}{\sqrt{1+x^2}} dx \\ \int \sqrt{1+x^2} dx &= x \sqrt{1+x^2}-\int \sqrt{1+x^2} dx + \ln \left| x+\sqrt{1+x^2} \right| &\color{green}{\text{by (f)}} \\ 2 \int \sqrt{1+x^2} dx &= x \sqrt{1+x^2} + \ln \left| x+\sqrt{1+x^2} \right| \\ \therefore \int \sqrt{1+x^2} dx &= \frac{x}{2} \sqrt{1+x^2} + \frac{1}{2} \ln \left| x+\sqrt{1+x^2} \right| +C\end{align}

## Example 10 – Integration by Parts of Cosine and Square Root Functions

Find $\displaystyle \int \cos \sqrt{x} dx$.

\begin{align} \require{AMSsymbols} \displaystyle \text{Let } \sqrt{x} &= t \\ x &= t^2 \\ dx &= 2t dt \\ \int \cos \sqrt{x} dx &= \int \cos t \ 2t dt \\ &= 2 \int t \cos t dt \color{green}{\cdots (1)} \\ &\color{green}{u = t, v^{\prime}=\cos t} \\ &\color{green}{u^{\prime}=1, v=\sin t} \\ \int t \cos t dt &= t \sin t-\int \sin t dt \\ &= t \sin t + \cos t \\ \color{green}{(1) \cdots} \int \cos \sqrt{x} dx &= 2 \left( t \sin t + \cos t \right) \\ &= 2t \sin t + 2 \cos t \\ &= 2 \sqrt{x} \sin \sqrt{x} + 2 \cos \sqrt{x} +C \end{align}

## Example 11 – Integration by Parts of Logarithmic functions

(a)     Find $\displaystyle \int x \ln x dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u^{\prime} = x, v= \ln x} \\ &\color{green}{u= \frac{x^2}{2}, v^{\prime}= \frac{1}{x}} \\ \int x \ln x dx &= \frac{x^2 \ln x}{2}-\int \frac{x}{2} dx \\ &= \frac{x^2 \ln x}{2}-\frac{x^2}{4}+C \end{align}

(b)     Hence, find $\displaystyle \int x (\ln x)^2 dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u^{\prime}= x, v = (\ln x)^2} \\ &\color{green}{u= \frac{x^2}{2}, v^{\prime}= \frac{2 \ln x}{x}} \\ \int x (\ln x)^2 dx &= \frac{x^2 (\ln x)^2}{2}-\int x \ln x dx \\ &= \frac{x^2 (\ln x)^2}{2}-\left(\frac{x^2 \ln x}{2}-\frac{x^2}{4} \right) &\color{green}{\text{by (a)}} \\ &= \frac{x^2 (\ln x)^2}{2}-\frac{x^2 \ln x}{2}+\frac{x^2}{4} +C \end{align}

## Example 12 – Integration by Parts of Logarithmic Functions

Find $\displaystyle \int x^2 \ln x dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u^{\prime} = x^2, v= \ln x} \\ &\color{green}{u= \frac{x^3}{3}, v^{\prime}= \frac{1}{x}} \\ \int x^2 \ln x dx &= \frac{x^3 \ln x}{3}-\int \frac{x^2}{3} dx \\ &= \frac{x^3 \ln x}{3}-\frac{x^3}{9}+C \end{align}

## Example 13 – Integration by Parts of

Find $\displaystyle \int x \sec^2 x dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u = x, v^{\prime}= \sec^2 x} \\ &\color{green}{u^{\prime}= 1, v= \tan x} \\ \int x \sec^2 x dx &= x \tan x-\int \tan x dx \\ &= x \tan x + \int \frac{-\sin x}{\cos x} dx \\ &= x \tan x + \int \frac{(\cos x)^{\prime}}{\cos x} dx \\ &= x \tan x + \ln \cos x +C \end{align}

## Example 14 – Integration by Parts of Secant Functions

Find $\displaystyle \int x \sin^2 x dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u = x, v^{\prime}= \sin^2 x=\frac{1-\cos 2x}{2}} \\ &\color{green}{u^{\prime}= 1, v=\frac{x}{2}-\frac{\sin 2x}{4} } \\ \int x \sin^2 x dx &= x\left(\frac{x}{2}-\frac{\sin 2x}{4} \right)-\int \left( \frac{x}{2}-\frac{\sin 2x}{4} \right) dx \\ &= \frac{x^2}{2}-\frac{x \sin 2x}{4}-\left( \frac{x^2}{4}+\frac{\cos 2x}{8} \right) \\ &= \frac{x^2}{2}-\frac{x \sin 2x}{4}-\frac{x^2}{4}-\frac{\cos 2x}{8} \\ &= \frac{x^2}{4}-\frac{x \sin 2x}{4}-\frac{\cos 2x}{8} + C \end{align}

## Example 15 – Integration by Parts of Inverse Sine functions

(a)     Find $\displaystyle \int \frac{x^2}{\sqrt{1-x^2}} dx$ by letting $x=\sin \theta$.

\begin{align} \require{AMSsymbols} \displaystyle x &= \sin \theta \\ dx &= \cos \theta d \theta \\ \int \frac{x^2}{\sqrt{1-x^2}} dx &= \int \frac{\sin^2 \theta}{\sqrt{1-\sin^2 \theta}} \cos \theta d \theta \\ &= \int \frac{\sin^2 \theta}{\cos \theta} \cos \theta d \theta \\ &= \int \sin^2 \theta d \theta \\ &= \int \frac{1-\cos 2 \theta}{2} d \theta \\ &= \frac{\theta}{2}-\frac{\sin 2 \theta}{4} \\ &= \frac{\theta}{2}-\frac{\sin \theta \cos \theta}{2} &\color{green} {\cos^2 \theta = 1-\sin^2 \theta = 1-x^2} \\ &&\color{green}{\cos \theta = \sqrt{1-x^2}} \\ &= \frac{\sin^{-1} x}{2}-\frac{x \sqrt{1-x^2}}{2}+C \end{align}

(b)     Hence, find $\displaystyle \int x \sin^{-1} x dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u^{\prime}= x,v = \sin^{-1} x} \\ &\color{green}{u= \frac{x^2}{2},v^{\prime}= \frac{1}{\sqrt{1-x^2}}} \\ \int x \sin^{-1} x dx &=\frac{x^2 \sin^{-1} x}{2}-\frac{1}{2} \int \frac{x^2}{\sqrt{1-x^2}} dx \\ &= \frac{x^2 \sin^{-1} x}{2}-\frac{1}{2} \left(\frac{\sin^{-1} x}{2}-\frac{x \sqrt{1-x^2}}{2} \right) &\color{green}{\text{by (a)}} \\ &= \frac{x^2 \sin^{-1} x}{2}-\frac{\sin^{-1} x}{4}+\frac{x \sqrt{1-x^2}}{4}+C \end{align}

## Example 16 – Integration by Parts of Inverse Tangent Functions

Find $\displaystyle \int x \tan^{-1} x dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u^{\prime}= x,v = \tan^{-1} x} \\ &\color{green}{u= \frac{x^2}{2},v^{\prime}= \frac{1}{1+x^2}} \\ \int x \tan^{-1} x dx &= \frac{x^2 \tan^{-1} x}{2}-\frac{1}{2} \int\frac{x^2}{1+x^2} dx \\ &= \frac{x^2 \tan^{-1} x}{2}-\frac{1}{2} \int \left( 1-\frac{1}{1+x^2} \right) dx \\ &= \frac{x^2 \tan^{-1} x}{2}-\frac{x}{2}+\frac{1}{2} \tan^{-1} x +C \end{align}

## Example 17 – Integration by Parts of Square Root Functions

Find $\displaystyle \int x \sqrt{1-x} dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u = x, v^{\prime}= \sqrt{1-x}} \\ &\color{green}{u^{\prime}= 1, v= \frac{-2 \sqrt{(1-x)^3}}{3}} \\ \int x \sqrt{1-x} dx &= x \times \frac{-2 \sqrt{(1-x)^3}}{3}-\int \frac{-2 \sqrt{(1-x)^3}}{3} dx \\ &= -\frac{2x \sqrt{(1-x)^3}}{3}+\frac{2}{3} \int \sqrt{(1-x)^3} dx \\ &= -\frac{2x \sqrt{(1-x)^3}}{3}-\frac{4 \sqrt{(1-x)^5}}{15}+C \end{align}

## Example 18 – Integration by Parts of Tangent Square Functions

Find $\displaystyle \int^{\frac{\pi}{4}}_0 x \tan^2 x dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u = x, v^{\prime}= \tan^2 x} \\ &\color{green}{u^{\prime}= 1, v= \tan x-x} \\ \int^{\frac{\pi}{4}}_0 x \tan^2 x dx &= \left[ x(\tan x-x) \right]^{\frac{\pi}{4}}_0-\int^{\frac{\pi}{4}}_0 (\tan x-x) dx \\ &= \left[ x(\tan x-x) \right]^{\frac{\pi}{4}}_0-\int^{\frac{\pi}{4}}_0 \frac{\sin x}{\cos x} dx + \int^{\frac{\pi}{4}}_0 x dx \\ &= \left[ x\tan x-x^2 + \ln \left| \cos x \right| + \frac{x^2}{2} \right]^{\frac{\pi}{4}}_0 \\ &= \left[ x\tan x-\frac{x^2}{2} + \ln \left| \cos x \right| \right]^{\frac{\pi}{4}}_0 \\ &= \frac{\pi}{4}-\frac{\pi^2}{32}-\ln \sqrt{2} \end{align}

## Example 19 – Definite Integration by Parts of Inverse Tangent Functions

Find $\displaystyle \int^1_0 x^2 \tan^{-1} x dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u = \tan^{-1} x, v^{\prime}= x^2} \\ &\color{green}{u^{\prime}= \frac{1}{1+x^2}, v= \frac{x^3}{3}} \\ \int^1_0 x^2 \tan^{-1} x dx &= \left[ \frac{x^3 \tan^{-1} x}{3} \right]^1_0-\frac{1}{3} \int^1_0 \frac{x^3}{1+x^2} dx \\ &= \left[ \frac{x^3 \tan^{-1} x}{3} \right]^1_0-\frac{1}{3} \int^1_0 \left( x-\frac{x}{1+x^2} \right) dx \\ &= \left[ \frac{x^3 \tan^{-1} x}{3} \right]^1_0-\frac{1}{3} \left( \frac{x^2}{2}-\frac{1}{2} \int^1_0 \frac{2x}{1+x^2} dx \right) \\ &= \left[ \frac{x^3 \tan^{-1} x}{3} \right]^1_0-\frac{x^2}{6} +\frac{1}{6} \int^1_0 \frac{\left(1+x^2\right)^{\prime}}{1+x^2} dx \\ &= \left[ \frac{x^3 \tan^{-1} x}{3}-\frac{x^2}{6}+\frac{1}{6} \ln \left(1+x^2\right) \right]^1_0 \\ &= \frac{\pi}{12}-\frac{1}{6}+\frac{1}{6} \ln 2 \end{align}

## Example 20 – Definite Integration by Parts of Natural Logarithmic Functions

Find $\displaystyle \int^{\infty}_1 \frac{\ln x}{x^2} dx$.

\begin{align} \require{AMSsymbols} \displaystyle &\color{green}{u = \ln x, v^{\prime}= \frac{1}{x^2}} \\ &\color{green}{u^{\prime}= \frac{1}{x}, v=-\frac{1}{x}} \\ \int^{\infty}_1 \frac{\ln x}{x^2} dx &= \left[ -\frac{\ln x}{x} \right]^{\infty}_1 + \int^{\infty}_1 \frac{1}{x^2} dx \\ &= \left[ -\frac{\ln x}{x}-\frac{1}{x} \right]^{\infty}_1 \\ &= 0-(0-1) \\ &= 1 \end{align}