I'm stuck.. can't remember how to integrate this (I'm sure I used to know)

How do I evaluate

$\displaystyle \int \dfrac{sin^{2}(x)}{1 + cos(x)}~dx$

I tried to do that z substitution thingy where

$\displaystyle z = tan(\dfrac{1}{2}x), sin(x) = \frac{2z}{1+z^{2}}, cos(x) = \frac{1-z^{2}}{1+z^{2}}, dx = \frac{2dz}{1+z^{2}}$

therefore

$\displaystyle \int \frac{sin^{2}(x)}{1 + cos(x)}~dx$ became $\displaystyle \int \frac{4z^{2}}{(1+z^{2})^{2}}~dz$

but I also still can't manage to evaluate it...

pls help guide me and also if you can help verify that my z substitution is correct please.