$\int \frac{\cos(x)}{(1+\cos(x))^3} \, dx$? I'm having a bit of a trouble seeing how to factorize the result of substituting $t=\tan(x/2)$, $\cos(x)=\frac{1-t^2}{1+t^2}$ and $dx=\frac{2}{1+t^2} \, dt$ into
$$\int \frac{\cos(x)}{(1+\cos(x))^3} \, dx$$
The result is
$$\int\frac{\frac{1-t^2}{1+t^2}}{(1+\frac{1-t^2}{1+t^2})^3}\frac{2}{1+t^2} \, dt$$ 
that looks horrible.

$$
\frac{\frac{1-t^2}{1+t^2}}{ \left(1+\frac{1-t^2}{1+t^2}\right)^3}\frac{2}{1+t^2}
$$
Start by multiplying the top and bottom of the expression above both by the common denominator $(1+t^2)^3$. The factor
$$
\frac{\frac{1-t^2}{1+t^2}}{1+t^2}
$$
becomes
$$
(1-t^2)(1+t^2).
$$
The factor
$$
\left( 1+ \frac{1-t^2}{1+t^2} \right)^3
$$
in the denominator becomes
$$
\Big( (1+t^2) + (1-t^2) \Big)
$$
and then simplifies to $2$.  You end up with
$$
\int \frac{(1-t^2)(1+t^2)} 2 \, dt = \int (1-t^4)\,dt.
$$
