Integrate $2\int x^2\, \sec^2x \,\tan x\, dx$

Solution 1:

Integrate by parts, differentiating $x^2$ and integrating $\sec ^{2}x\tan x$ by substitution$^1$:

$$\begin{eqnarray*} I &=&\int x^{2}\sec ^{2}x\tan x\, dx=\frac{1}{2}x^{2}\sec ^{2}x-\int x\sec ^{2}x\,dx \\ &=&\frac{1}{2}x^{2}\sec ^{2}x-\left( x\tan x-\int \frac{\sin x }{\cos x}\,dx\right)\qquad \text{by parts; note }^2 \\ &=&\frac{1}{2}x^{2}\sec ^{2}x-x\tan x-\ln |\cos x|+C. \end{eqnarray*}$$ So $$ \begin{equation*} 2I=2\int x^{2}\sec ^{2}x\tan x dx=x^{2}\sec ^{2}x-2x\tan x-2\ln | \cos x|+C. \end{equation*} $$

--

$^1$ Let $u=\sec x$. Then $du=\sec x\, \tan x$ and

$$\int \sec ^{2}x\tan xdx=\int u\,du=\frac{1}{2}u^{2}=\frac{1}{2}\sec ^{2}x.$$

$^2$ Differentiate $x$ and integrate $\sec^2 x$. Since $\dfrac{d}{dx}\tan x=1+\tan ^{2}x=\sec ^{2}x$, $\displaystyle\int \sec ^{2}xdx=\tan x $.

Solution 2:

Hint: Integrate by parts twice and in each case assume $u$ to be the polynomial function and consider $dv$ for the first integration by parts as $$ dv = \sec(x) (\sec(x)\tan(x)) dx \implies v = \frac{1}{2} \sec^2(x). $$

Can you finish it?