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.

You have been simplifying things up until line 6 and then kind of turned back into complications. It would be natural to notice that
$$\sin x dx = -d\left(\cos x\right)$$
Then the integral looks as follows:
$$I=-\int\frac{1-\cos^2x}{\cos x}d\left(\cos x\right)$$
So it appears that $\cos x$ plays the role of a variable in its own right, so why not let for example $t=\cos x$. Now
$$I=-\int\frac{1-t^2}{t}dt=-\int\frac{dt}{t}+\int tdt=-\ln t+\frac{t^2}{2}+C$$
Now plug $\cos x$ back into place.
Recognising distinct "reusable" blocks within the expression is the most natural way to arrive at useful substitutions.
