solve cos^2(x) = a*cos(x) + b*sin(x) for a and b