\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\un}{\underline}
\parindent=0pt
\begin{document}

{\bf Question}

Use integration by parts to show that if

$$I_n=\ds\int_0^{\frac{\pi}{4}} \tan^n x \,dx,\ n \geq 2,$$

then

$$I_n+I_{n-2}=\ds\frac{1}{n-1}.$$

(Hint: Write $\tan^n x=\tan^{n-2}x \tan^2 x$ and use an
appropriate trigonometric identity for $\tan^2 x$).

Evaluate $I_0$. Hence show that

$$I_8=\ds\frac{\pi}{4}-\ds\frac{76}{105}$$


\medskip

{\bf Answer}
\begin{eqnarray*} I_n & = & \ds\int_0^{\frac{\pi}{4}} \tan^n x
\,dx\\ & = & \ds\int_0^{\frac{\pi}{4}} \tan^{n-2}x \tan^2 x \,dx\\
& = & \ds\int_0^{\frac{\pi}{4}}\tan^{n-2}x(\sec^2x-1) \,dx\\ & &
\cos^2x+\sin^2 x=1 \Rightarrow 1+\tan^2 x=\sec^2 x\\ & = &
\ds\int_0^{\frac{\pi}{4}}\tan^{n-2}x \sec^2x \,dx
-\ds\int_0^{\frac{\pi}{4}}\tan^{n-2} x \,dx\\ & = &
\ds\int_0^{\frac{\pi}{4}}\tan^{n-2}x \sec^2 x \,dx-I_{n-2}
\end{eqnarray*}

set $J=\ds\int_0^{\frac{\pi}{4}} \tan^{n-2}x \sec^2 x \,dx$

$$v=\tan^{n-2}x;\ \ \ds\frac{du}{dx}=\sec^2x$$

$$\ds\frac{dv}{dx}=(n-2)\tan^{n-2}x\sec^2x;\ \ u=\tan x$$

\newpage
Integrate by parts:

\begin{eqnarray*} J & = & [\tan^{n-2}x \tan
x]_0^{\frac{\pi}{4}}-\ds\int_0^{\frac{\pi}{4}}(n-2)\tan^{n-2}x
\sec^2 x \tan x\\ & = &
1-(n-2)\ds\int_0^{\frac{\pi}{4}}\tan^{n-2}x \sec^2 x \,dx\\
\Rightarrow J & = & 1-(n-2)J\\ \Rightarrow J & = &
\un{\ds\frac{1}{n-1}} \end{eqnarray*}

Thus

$$I_n=\ds\frac{1}{n-1}-I_{n-2}$$

$$\Rightarrow \un{I_n+I_{n-2} =\ds\frac{1}{n-1}}$$ as required.

$$I_0=\ds\int_0^{\frac{\pi}{4}}\tan^0x \,dx=\ds\frac{\pi}{4}$$

so

\begin{eqnarray*} I_{2n} & = & \ds\frac{1}{2n-1}-I_{2n-2}\\
I_{2n-1} & = & \ds\frac{1}{2n-2}-I_{2n-4}\\ I_{2n-4} & = &
\ds\frac{1}{2n-5}-I_{2n-6}\\ & \vdots &\\ I_8 & = &
\ds\frac{1}{}7-I_6\\ I_6 & = & \ds\frac{1}{5}I_4\\ I_4 & = &
\ds\frac{1}{3}-I_2\\ I_2 & = & 1-I_0\\ & = & 1-\ds\frac{\pi}{4}
\end{eqnarray*}

back substitute:
\begin{eqnarray*} I_4 & = &
\ds\frac{1}{3}-\left(1-\ds\frac{\pi}{4}\right)=\ds\frac{1}{3}-1+\ds\frac{\pi}{4}\\
I_6 & = &
\ds\frac{1}{5}-\left(\ds\frac{1}{3}-1+\ds\frac{\pi}{4}\right)
=\ds\frac{1}{5}-\ds\frac{1}{3}+1-\ds\frac{\pi}{4}\\ I_8 & = &
\ds\frac{1}{7}-\left(\ds\frac{1}{5}-\ds\frac{1}{3}+1-\ds\frac{\pi}{4}\right)
=\ds\frac{1}{7}-\ds\frac{1}{5}+\ds\frac{1}{3}-1+\ds\frac{\pi}{4}
=\ds\frac{\pi}4{}-\ds\frac{76}{10} \end{eqnarray*}

as required.

\end{document}
