Solve for x cos(x)^2=sin(x/2)^2