<s>[INST] 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!
 [/INST] 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.
</s>