Cotangent is just 1 over tangent so

In the same way that cosecant is 1 over sine, and secant is 1 over cosine.

--------------------------------------------------

So your intitial equation is:

then multiply both sides by

Simplify (cancel out tangents on LHS and x's on RHS) to get your second equation.

You can partition the RHS like so:

And you see that on the RHS 1/tangent = cotangent so

Which is your last equation.

--------------------------------------------------

Some other things to note:

since you can multiply both sides by tangent over cotangent and get

and also since

it follows that

so