I am trying to do this problem completely on my own but I can not get a proper answer for some reason
$\begin{align} \int \cos^2 x \tan^3x dx &=\int \cos^2 x \frac{ \sin^3 x}{ \cos^3 x}dx\\ &=\int \frac{ \cos^2 x\sin^3 x}{ \cos^3 x}dx\\ &=\int \frac{ \sin^3 x}{ \cos x}dx\\ &=\int \frac{ \sin^2 x \sin x}{ \cos x}dx\\ &=\int \frac{ (1 -\cos^2 x) \sin x}{ \cos x}dx\\ &=\int \frac{ (\sin x -\cos^2 x \sin x) }{ \cos x}dx\\ &=\int \frac{ \sin x -\cos^2 x \sin x }{ \cos x}dx\\ &=\int \frac{ \sin x }{ \cos x}dx - \int \cos x \sin x dx\\ &=\int \tan x dx - \frac{1}{2}\int 2 \cos x \sin x dx\\ &=\ln|\sec x| - \frac{1}{2}\int \sin 2x dx\\ &=\ln|\sec x| + \frac{\cos 2x}{4} + C \end{align}$
This is the wrong answer, I have went through and back and it all seems correct to me.