Help Needed To Prove A Trigonometric Identity

I'am trying to prove the below identity, but this is what i end up getting. \begin{align*} \frac{2\tan(x)}{1 + \tan^2(x)} &= \sin(2x)\\ &= \frac{2\frac{\sin(x)}{\cos(x)}}{1 + \frac{\sin^2(x)}{\cos^2(x)}}\\ &= 2\sin(x) \end{align*}

Can someone point out the mistake for me please?

-
$\frac{\cos^2 x}{\cos x} = \cos x \neq 1$ for general $x$. –  Pacciu Mar 14 '12 at 18:36
Your last step went wrong. It should be $\frac{2\frac{\sin(x)}{\cos(x)}}{1 + \frac{\sin^2(x)}{\cos^2(x)}} = 2\frac{\frac{\sin(x)}{\cos(x)}}{{\frac{\cos^2(x)+\sin^2(x)}{\cos^2(x)}}} = 2\sin(x)\cos(x) = \sin(2x)$ Using the fact that $\sin^2(x)+\cos^2(x)=1$ –  Kirthi Raman Mar 14 '12 at 20:30

$$\frac{2\tan(x)}{1 + \tan^2(x)} = \frac{2\frac{\sin(x)}{\cos(x)}}{1 + \frac{\sin^2(x)}{\cos^2(x)}}= 2\sin(x)\cos(x)=\sin(2x)$$
Hint: $1=\frac{cos^2(x)}{cos^2(x)}$