Derivation of the tangent half angle identity 
I'm having trouble proceeding from 
  $$\frac{\sin(\theta)}{1+\cos(\theta)}$$
  to
  $$\tan\left(\frac{\theta}{2}\right)$$

Context:

Consider the function $f$ defined for all $(x,y)$ such that $y \neq 0$, with the rule $$f(x,y) = \frac{y}{\sqrt{x^2+y^2}+x}$$
  Show that $$f(r\cos(\theta),r\sin(\theta)) = \tan\left(\frac{\theta}{2}\right)$$

So far I've done:
$$f(r\cos(\theta),r\sin(\theta)) = \frac{r\sin(\theta)}{\sqrt{r^2\cos^2(\theta) + r^2\sin^2(\theta)}+r\cos(\theta)} = \frac{r\sin(\theta)}{\sqrt{r^2}+r\cos(\theta)}\\=\frac{\sin(\theta)}{1+\cos(\theta)}$$
Using $$\cos(\theta) = 2\cos^2\left(\frac{\theta}{2}\right)-1 \implies 2\cos^2\left(\frac{\theta}{2}\right)=\cos(\theta)+1$$
We get $$f(r\cos(\theta),r\sin(\theta)) = \frac{\sin(\theta)}{2\cos^2\left(\frac{\theta}{2}\right)}$$
But I can't see how to proceed from here to the required result. Thanks in advance for any help!
 A: It's possible to understand many trigonometric identities with the unit circle.
Once you understand them, it's also much easier to remember them.
You can use two unit circles (one for $a$, one for $b$) to build a rhombus:

The sides of this rhombus have length 1.
From this diagram, you can see that:
$$\tan\left(\frac{a+b}{2}\right) = \frac{\sin\left(\frac{a+b}{2}\right)}{\cos\left(\frac{a+b}{2}\right)}=\frac{\sin\left(a\right) + \sin\left(b\right)}{\cos\left(a\right)+\cos\left(b\right)}$$
In particular, with $a = 0$ and $b = \theta$, you have:
$$\tan\left(\frac{\theta}{2}\right) = \frac{0 + \sin\left(\theta\right)}{1 + \cos\left(\theta\right)}$$
A: Hint: The numerator can be written as
$$ \sin\theta = \sin \left(2 \cdot \frac{\theta}{2}\right) = 2\sin\frac{\theta}{2}\cos\frac{\theta}{2}. $$
A: It is a lot easier to use some trig. identities: $\sin (\theta) =2 \sin (\theta /2) \cos (\theta /2)$ and $1+\cos \theta =2\cos ^{2} (\theta /2)$. You will immediately get the result from these two formulas. 
A: Let $L=\frac{\sin \theta}{1+\cos \theta}$ and $R=\tan(\theta/2)$.
Left
\begin{align}
\frac{\textrm{d}L}{\textrm{d}\theta} &= \frac{\cos\theta(1+\cos\theta)-\sin\theta (-\sin\theta)}{(1+\cos \theta)^2}\\
&=\frac{1}{1+\cos\theta}
\end{align}
Again
\begin{align}
\frac{\textrm{d}^2L}{\textrm{d}\theta^2} &= -(1+\cos\theta)^{-2}(-\sin\theta)\\
&=\frac{\sin\theta}{1+\cos\theta}\frac{1}{1+\cos\theta}\\
&=L\frac{\textrm{d}L}{\textrm{d}\theta} 
\end{align}
Right
\begin{align}
\frac{\textrm{d}R}{\textrm{d}\theta} &= \frac{\sec^2(\theta/2)}{2}\\
&= \frac{1+\tan^2(\theta/2)}{2}\\
2\frac{\textrm{d}R}{\textrm{d}\theta} &= 1+R^2
\end{align}
Again
\begin{align}
2\frac{\textrm{d}^2R}{\textrm{d}\theta^2} &= 2R\frac{\textrm{d}R}{\textrm{d}\theta}\\
\frac{\textrm{d}^2R}{\textrm{d}\theta^2} &= R\frac{\textrm{d}R}{\textrm{d}\theta}
\end{align}
Conclusion
\begin{align}
L&=R\\
\frac{\sin \theta}{1+\cos \theta}&=\tan(\theta/2)
\end{align}
Edit
Assume that the questioner and his friend were asked to solve a differential equation $y''=yy'$ with $y(0)=0$ and $y'(0)=1/2$. 
Making the story short, he and his friend found the solution, $y=\frac{\sin\theta}{1+\cos\theta}$ and $y=\tan(\theta/2)$, respectively.
He now can proceed from $\frac{\sin\theta}{1+\cos\theta}$ to $\tan(\theta/2)$
without doubt.
