I know that the antiderivative is cos^2(x) is (x+cos(x)sin(x))/2, but how the heck can you derive it?
Make the appropriate substitution suggested by the double angle formula:
$\displaystyle \cos (2x) = 2 \cos^2 (x) - 1 \Rightarrow \cos^2 (x) = \frac{1}{2} \, (\cos(2x) + 1)$.
Then, after integrating, make the substitution $\displaystyle \sin (2x) = 2 \sin x \cos x$ in your answer.