# How do you integrate int xtan^2x using integration by parts?

Aug 26, 2016

Use ${\tan}^{2} x = {\sec}^{2} x - 1$ first.

#### Explanation:

$x {\tan}^{2} x = x {\sec}^{2} x - x$

$- \int x \mathrm{dx} = - {x}^{2} / 2$

$\int x {\sec}^{2} x \mathrm{dx}$

Let $u = x$ and $\mathrm{dv} = {\sec}^{2} x \mathrm{dx}$, so that

$\mathrm{du} = \mathrm{dx}$ and $v = \tan x$ to get

$\int x {\sec}^{2} x \mathrm{dx} = x \tan x - \int \tan x \mathrm{dx}$.

Now integrate $\tan x = \sin \frac{x}{\cos} x$ using substitution $u = \cos x$.

$\int x {\sec}^{2} x \mathrm{dx} = x \tan x - \left(- \ln \left\mid \cos x \right\mid\right) = x \tan x + \ln \left\mid \cos \right\mid x$

Finish by putting it all together.

$\int x {\tan}^{2} x = - {x}^{2} / 2 + x \tan x + \ln \left\mid \cos \right\mid x + C$.