# Definite integration (Weierstrass)

By using the substitution $u=\tan\frac{1}{2}x$, prove that $\int_{0}^{\frac{\pi}{2}}\frac{1}{5-4\ cosx}dx=\frac{2}{3}\tan ^{-1}(3)$. Hence find $\int_{0}^{\frac{\pi}{2}}\frac{\cos x}{5-4\cos x}dx$.

My attempt,

Let $u=\tan (\frac{1}{2})x$

$du=\frac{1}{2}dx\sec ^2(\frac{x}{2})$

By Weierstrass substitution,

$\sin(x)=\frac{2u}{u^2+1}$

$\cos(x)=\frac{1-u^2}{u^2+1}$

$dx=\frac{2du}{u^2+1}$

$=\int_{0}^{1}\frac{2}{(u^2+1)(5-\frac{4(1-u^2)}{u^2+1})}du$

$=\int_{0}^{1}\frac{2}{9u^2+1}du$

$2\int_{0}^{1}\frac{1}{9u^2+1}du$

Let $s=3u$ $ds=3du$

$=\frac{2}{3}\int_{0}^{3}\frac{1}{s^2+1}ds$

$=\frac{2}{3}\left | \tan^{-1}(s) \right |_{0}^{3}$

$=\frac{2}{3}\tan^{-1}(3)$

How to relate the first part to the second? ($\int_{0}^{\frac{\pi}{2}}\frac{\cos x}{5-\cos x}dx$.)

Observe that $$\frac{\cos x}{5-4\cos x}=\frac{1}{4}\left[\frac{4\cos x-5}{5-4\cos x}+\frac{5}{5-4\cos x}\right]=\frac{1}{4}\left[-1+\frac{5}{5-4\cos x}\right].$$