Trig identity manipulation question

I'm working on manipulating trig identities and using Wolfram Alpha to check the identity still holds.

I'm going from this:

$$\frac{1-\cos x}{1+\cos x} = \frac{1}{tan^2x}-\frac{2}{\tan x \sin x} + \frac{1}{\sin^2 x}$$

which WA verifies is an identity to this:

$$\frac{1+\cos x}{1-\cos x} = tan^2x-\frac{\tan x \sin x}{2} + \sin^2 x$$

Based on my workings out on paper, I think I'm safe in flipping both sides. Wonder if someone might weigh in on this to help me out please?

-
The second equality is a trigonometric equation in $x$. The first equality which is an identity doesn't imply the second. –  Américo Tavares Nov 13 '12 at 14:25
@AméricoTavares: Would you mind elaborating on why the first doesn't imply the second please? To use an example, the identity $\tan x = \frac{\sin x}{\cos x}$ can be flipped to show $\frac{1}{\tan x} = \frac{\cos x}{\sin x}$ so why can't I do the same above? –  PeteUK Nov 13 '12 at 14:38
@AméricoTavares: Mike's answer has cleared it up for me now, thanks. –  PeteUK Nov 13 '12 at 15:25
The reciprocal of a sum is not equal to the sum of the reciprocals. If $\frac1a=\frac1b+\frac1c, a=\frac{bc}{b+c}$, not $b+c$
Your right side is equal to $(\csc x-\cot x)^2$. If you really want to flip both sides, you'll get
$$\frac{1+\cos x}{1-\cos x}=\frac1{(\csc x-\cot x)^2}=\frac{(\csc x+\cot x)^2}{(\csc^2x-\cot^2x)^2}=$$ $$(\csc x+\cot x)^2=\frac1{\tan^2x}+\frac2{\tan x\sin x}+\frac1{\sin^2x}$$
Got it. The "workings out on paper" I mentioned started with $\frac{a}{b}=\frac{c}{d} - \frac{e}{f}$ which I erroneously manipulated from $\frac{b}{a}=\frac{df}{cf-de}$ to $\frac{b}{a}=\frac{df}{cf} - \frac{df}{de}$ –  PeteUK Nov 13 '12 at 15:05