The equation as written "(1/cosx)(cosx) = cosx/sinx" is NOT an identity.
The left hand side is equal to 1 as long as cosx≠0, but the right hand side is not always equal to 1...
For example, if x = 3π/4, (1/cosx)(cosx) = 1, but cosx/sinx = -1
Is there a typo?