Please try yourself. I've solved on my own for purely academic purpose.
cos@ + cos2@ = p
=> 2cos(3@/2)cos(@/2) = p
sin@ + sin2@ = q
=> 2sin(3@/2)cos(@/2) = q
So first eq : cos²(3@/2)cos²(@/2) = p²4
Second eq : sin²(3@/2)cos²(@/2) = q²4
Now add these two to get
4cos²(@/2) [sin²x + cos²x] = p² + q² where x = 3@/2
=> 4cos²(@/2) = p² + q²
=> 2cos²(@/2) = p²/2 + q²/2
=> 1 + cos@ = p²/2 + q²/2
=> cos@ = p²/2 + q²/2 - 1
So in cos@ + cos2@ = p
=> cos@ + 2cos²@ - 1 = p
=> 2cos²@ + cos@ - (1 + p) = 0
So cos@ = -1 ± √1 + 4(1 + p)²4
Replace cos@ by p²/2 + q²/2 - 1.
When you want to post many questions in one thread, but miss out, use the EDIT button please. Multi-posting looks stupid.