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 very simple way to check if the answer to an indefinite integral is correct is to differentiate the answer. If you get the original function, your answer is correct, and is equal, up to a constant, with any other solutions.
We have
$$\begin{align*}
\frac{d}{dx}\left(\ln|\sec x| + \frac{\cos 2x}{4} + C\right) &= \frac{1}{\sec x}(\sec x)' + \frac{1}{4}(-\sin(2x))(2x)' + 0\\
&= \frac{\sec x\tan x}{\sec x} - \frac{1}{2}\sin(2x)\\
&= \tan x - \frac{1}{2}\left(2\sin x\cos x\right)\\
&= \frac{\sin x}{\cos x} - \sin x\cos x\\
&= \frac{ \sin x - \sin x\cos^2 x}{\cos x}\\
&= \frac{\sin x(1 - \cos^2 x)}{\cos x}\\
&= \frac{\sin^3 x}{\cos x}\\
&= \frac{\sin ^3 x \cos^2 x}{\cos^3x}\\
&= \frac{\sin^3 x}{\cos^3 x}\cos^2 x\\
&= \tan^3 x \cos^2 x.
\end{align*}$$
So your answer is right.
This happens a lot with integrals of trigonometric identities, because there are a lot of very different-looking expressions that are equal "up to a constant". So the answer to $$\int\sin x\cos x\,dx$$
can be either $\sin^2 x + C$ or $-\cos^2x + C$; both correct, though they look different, because they differ by a constant: $-\cos^2x + C = 1-\cos^2x + (C-1) = \sin^2x + (C-1)$. 
