Put $\tan \frac{x}{2}= t , $
$\therefore \frac{x}{2}=\tan ^{-1} t \text {, }$
$\therefore x=2 \tan ^{-1} t$
$\therefore d x=\frac{2}{1+t^2} d t$
and $\cos x=\frac{1-t^2}{1+t^2}$
$\therefore I=\int \frac{\frac{2 d t}{1+t^2}}{5-4\left(\frac{1-t^2}{1+t^2}\right)}$
$=\int \frac{2 d t}{5+5 t^2-4+4 t^2}$
$=2 \int \frac{d t}{9 t^2+1}$
$=2 \int \frac{d t}{(3 t)^2+1}$
$=\frac{2}{3} \tan ^{-1}(3 t)+c$
$=\frac{2}{3} \tan ^{-1}\left(3 \tan \frac{x}{2}\right)+c$
