Differentiate. $y = (1 − \sec x) / \tan x$ I have no idea what I have done wrong. Please criticise.

Differentiate $y = \frac{1 - \sec x}{\tan x}$.
\begin{align*}
  \frac{d}{dx} \left[ \frac{1 - \sec x}{\tan x} \right]
    &= \frac{\tan x \frac{d}{dx} [ 1 - \sec x ] - (1 - \sec x) \frac{d}{dx} \tan x }{(\tan x)^2} \\
    &= \frac{\tan x (- \sec x \tan x) - [(1 - \sec x) (-\csc^2 x)]}{(\tan x)^2} \\
    &= \frac{-\tan^2 x \sec x + \csc^2 x - \sec x \csc^2 x}{(\tan x)^2}
\end{align*}


Hint:
$$
\dfrac{d}{dx} \tan x= \sec^2 x
$$
Here you was wrong.
