What is wrong with my solution? $\int \cos^2 x \tan^3x dx$ 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.

A simple $u$-substitution will work even better, IMO. ${\cos^2\theta\tan^3\theta }$ yields ${\frac {\sin^3}{\cos\theta}}$ So starting from there $${\int\frac{\sin^2\theta}{\cos\theta}\sin\theta d\theta}$$ then $${\int\frac{1-\cos^2\theta}{\cos\theta}\sin\theta d\theta}$$ Let
$u={\cos \theta}$ then ${du=-\sin\theta d\theta}$ $${-\int\frac {1-u^2}{u}du}$$ let ${v=1-u^2 }$    ${dv=-2u}$
let ${dw=1/u}$, ${w=\ln u}$ 
thus $${\ln u(1-u^2)+\int 2u\ln u}\,du$$ 
then
let ${v=\ln u}$, ${dv=u^{-1}}$
let ${dw=2u}$, ${w=u^2}$ 
then 
$$\begin{align*}
{\ln u u^2-\int \frac{u^2}{u}\,du}\\{\ln u u^2-\int u\,du}\\
{\ln u(1-u^2)+\ln u u^2-1/2u^2}
\end{align*}$$
 then 
$$\begin{align*}{\ln u(1-u^2+u^2)-1/2u^2}\\ 
{-(\ln u-1/2u^2)}
\end{align*}
$$ 
substituting back yields $${-\ln\cos\theta+1/2\cos^2\theta+c}$$
