Proving Trigonometric Equality I have this trigonometric equality to prove:
$$\frac{\cos x}{1-\tan x}-\frac{\sin x}{1+\tan x}=\frac{\cos x}{2\cos^2x-1}$$
I started with the left hand side, reducing the fractions to common denominator and got this:
$$\frac{\cos x+\cos x\tan x-\sin x+\sin x\tan x}{1-\tan^2x}\\=\frac{\cos x+\cos x(\frac{\sin x}{\cos x})-\sin x+\sin x(\frac{\sin x}{\cos x})}{1-\left(\frac{\sin^2x}{\cos^2x}\right)}\\=\frac{\cos x+\left(\frac{\sin^2x}{\cos x}\right)}{1-\frac{\sin^2}{\cos^2x}}$$and by finding common denominator top and bottom and then multiplying the fractions i got: $$\frac{\cos^2x}{\cos^3x-\cos x\sin^2x}$$ which is far from the right hand side and I don't know what am I doing wrong. What is the correct way to prove this equality?

$$\frac { cosx }{ 1-tanx } -\frac { sinx }{ 1+tanx } =\frac { cosx }{ 2cos^{ 2 }x-1 } \\ \frac { \cos { x } \left( 1+tanx \right)  }{ \left( 1-tanx \right) \left( 1+tanx \right)  } -\frac { \sin { x } \left( 1-tanx \right)  }{ \left( 1-tanx \right) \left( 1-tanx \right)  } =\\ =\frac { \cos { x } +\sin { x } -\sin { x } +\frac { \sin ^{ 2 }{ x }  }{ \cos { x }  }  }{ 1-\tan ^{ 2 }{ x }  } =\frac { \frac { \cos ^{ 2 }{ x+\sin ^{ 2 }{ x }  }  }{ \cos { x }  }  }{ \frac { \cos ^{ 2 }{ x-\sin ^{ 2 }{ x }  }  }{ \cos ^{ 2 }{ x }  }  } =\\ =\frac { \cos { x }  }{ \cos ^{ 2 }{ x-\sin ^{ 2 }{ x }  }  } =\frac { \cos { x }  }{ 2\cos ^{ 2 }{ x-1 }  } $$
