If $\frac{1+\sin{\theta}}{\cos{\theta}} = n$, find $\tan{\frac{1}{2}\theta}$. The question is:

If $\cfrac{1+\sin{\theta}}{\cos{\theta}} = n$, find $\tan{\frac{1}{2}\theta}$.

I'm quite confused on how to solve this problem. What trigonometric identities do I use? I tried squaring them and ended with $n^2=\dfrac{1+\sin{\theta}}{1-\sin{\theta}}$ but I suppose that doesn't really help the problem. Any suggestions would be appreciated.
 A: Let $\alpha = \frac{\theta}{2} \; \to \; \theta = 2\alpha$, and use the double-angle formulae to convert from $\sin(2\alpha)$ and $\cos(2\alpha)$ to functions of $\tan(\alpha)$, to get
$$\begin{equation}\begin{aligned}
n & = \frac{1 + \sin(2\alpha)}{\cos(2\alpha)} \\
& = \frac{1 + \frac{2\tan(\alpha)}{1+\tan^2(\alpha)}}{\frac{1-\tan^2(\alpha)}{1+\tan^2(\alpha)}} \\
& = \frac{(1+\tan^2(\alpha))+2\tan(\alpha)}{1-\tan^2(\alpha)} \\
& = \frac{(1+\tan(\alpha))(1+\tan(\alpha))}{(1-\tan(\alpha))(1+\tan(\alpha))} \\
& = \frac{1+\tan(\alpha)}{1-\tan(\alpha)}
\end{aligned}\end{equation}$$
Cross-multiplying and simplifying then gives
$$\begin{equation}\begin{aligned}
n - n\tan(\alpha) & = 1 + \tan(\alpha) \\
(-n - 1)\tan(\alpha) & = 1 - n \\
\tan(\alpha) & = \frac{n-1}{n+1}
\end{aligned}\end{equation}$$
A: Split LHS into two terms. We get $n-\tan \theta =\sec \theta$. Squaring we get $n^{2}+\tan^{2}\theta-2n\tan \theta=1+\tan^{2}\theta$. Can you continue?
A: If we also have the "tangent half-angle" identity  $ \ \tan \frac{\theta}{2} \ = \ \frac{1 \ - \ \cos \theta}{\sin \theta} \ \ , \ $ we can approach the problem in this way.  From $ \ n \ = \ \frac{1 \ + \ \sin \theta}{\cos \theta} \ = \ \sec \theta + \tan \theta \ \Rightarrow \ \tan \theta \ = \ n  -  \sec \theta \ \ , \ $ construct a right triangle with this tangent "value".  (We will produce an expression for the hypothenuse $ \ H \ $ shortly.)

It is clear that $ \ \sec \theta \ = \ H \ \ . \ $ We then have
$$  \ \tan \frac{\theta}{2} \ \ = \ \  \csc \theta \  - \ \cot \theta  \ \ = \ \ \frac{H \ - \ 1}{n \ - \ H} \ \  .  $$
From the "Pythagorean theorem", we find
$$ H^2 \ - \ 1 \ \ = \ \ (n \ - \ H)^2 \ \ = \ \ n^2 \ - \ 2nH \ + \ H^2 \ \ \Rightarrow \ \ nH \ \ = \ \ \frac{n^2 \ + \ 1}{2} \ \ . $$
Consequently,
$$  \ \tan \frac{\theta}{2} \ \ = \ \ \frac{nH \ - \ n}{n^2 \ - \ nH} \ \ = \ \   \frac{\left(\frac{n^2 \ + \ 1}{2} \right) \ - \ n}{n^2 \ - \ \left(\frac{n^2 \ + \ 1}{2} \right)} \ \  = \ \ \frac{ n^2 \ + \ 1  \ - \ 2n}{2n^2 \ - \  ( n^2 \ + \ 1 )} $$
$$   = \ \ \frac{ n^2 \ - \ 2n \ + \ 1  }{ n^2 \ - \   1 } \ \ = \ \ \frac{ (n \ - \   1)^2  }{ (n \ + \ 1) · (n \ - \ 1) } \ \ = \ \ \frac{  n \ - \   1   }{  n \ + \ 1  } \ \ .  $$
[This contains elements appearing in the other answers, arrived at in a different way.  This is perhaps inevitable since all of them hinge on the "Pythagorean identity" $ \ \tan^2 \theta \ + \ 1 \ = \ \sec^2 \theta \ $ in some manner.]
