Express $\tan\alpha-i$ in the form $r(\cos\theta+i\sin\theta)$ 
Express $\tan\alpha-i$ in the form $r(\cos\theta+i\sin\theta)$

My Attempt:
$\frac{\sin\alpha-i\cos\alpha}{\cos\alpha}=\sec\alpha(\cos(\frac{3\pi}2+\alpha)+i\sin(\frac{3\pi}2+\alpha))$
Is my answer incomplete?
The answer given in the book is
$\sec\alpha(\cos(\alpha-\frac{\pi}2)+i\sin(\alpha-\frac{\pi}2)), 0\le\alpha\lt\frac\pi2$
And,
$-\sec\alpha(\cos(\frac{\pi}2+\alpha)+i\sin(\frac{\pi}2+\alpha)), \frac\pi2\lt\alpha\le\pi$
Is the answer given in book better? Also, why have they considered only first and second quadrants and not third and fourth?
 A: To answer the last question first, the tangent function has period $\pi,$ and is undefined at odd multiples of $\frac{\pi}{2}.$ Thus, in order to specify the behavior of $\tan\alpha-i,$ it suffices to do so for only two quadrants. I generally prefer to do so for all $\alpha$ in the interval $\left(-\frac{\pi}{2},\frac{\pi}{2}\right).$ Strangely, the book decided to do so for the two intervals $\left[0,\frac{\pi}{2}\right)$ and $\left(\frac{\pi}{2},\pi\right],$ instead. This is a bit odd, because once it has been stated what happens for $\alpha=0,$ periodicity already tells you what happens for $\alpha=\pi.$

Now let's see if one of them is better than the other.
The secant function has period $2\pi,$ and is undefined at odd multiples of $\frac{\pi}{2}.$ Consequently, both your formula and the book's formulas are undefined when $\alpha$ is an odd multiple of $\frac{\pi}{2},$ just like $\tan\alpha-i$ is. Looking good so far!
The cosine and sine functions have a period of $2\pi$. Since $\alpha-\frac{\pi}{2}+2\pi=\frac{3\pi}{2}+\alpha,$ then $\cos\left(\frac{3\pi}{2}+\alpha\right)=\cos\left(\alpha-\frac{\pi}{2}\right)$ and $\sin\left(\frac{3\pi}{2}+\alpha\right)=\sin\left(\alpha-\frac{\pi}{2}\right).$ Thus, for $0\leq\alpha<\frac{\pi}{2},$ your formula is equal to the book's formula.
Another property of the sine and cosine functions is that a shift of $\pi$ in either direction negates them--that is, for example, $\sin(\theta+\pi)=-\sin(\theta).$ Since $\frac{\pi}{2}+\alpha+\pi=\frac{3\pi}{2}+\alpha,$ then $\cos\left(\frac{3\pi}{2}+\alpha\right)=-\cos\left(\frac{\pi}{2}+\alpha\right)$ and $\sin\left(\frac{3\pi}{2}+\alpha\right)=\sin\left(\frac{\pi}{2}+\alpha\right).$ Thus, once again, for $\frac{\pi}{2}<\alpha\leq\pi,$ your formula is equal to the book's formula.

So why did the book make two different formulas, if your one formula is equal to their formulas? Well, the kicker about the form $r(\cos\theta+i\sin\theta)$ is that $r$ must be non-negative. That's why the book split things up piecewise, and why your answer is not quite right.
