I solved a little trigonometric equation but it seems that my solution is false and I am trying to understand why as I think it's a very basic problem.
The aim is to try to find the value of the angle $\phi$ as a function of $\theta$ in the following system :
$$\cos(\phi) = \sin\left(\frac{\theta}{2}\right)$$ and $$\sin(\phi) = -\cos\left(\frac{\theta}{2}\right)$$
I've simply noted that $\cos(\phi)$ can be written as : $$\cos(\phi) = -\cos\left(\frac{\theta}{2} + \frac{\pi}{2}\right)$$ and also : $$\sin(\phi) = -\sin\left(\frac{\theta}{2} + \frac{\pi}{2}\right)$$
Therefore, we end with an equation to solve which is $\tan(\phi) = \tan\left(\frac{\theta}{2} + \frac{\pi}{2}\right)$ giving : $$\phi = \frac{\theta}{2} + \frac{\pi}{2} + k\pi$$
However, the correction of the problem points to the fact that $$\phi = \frac{\theta}{2} - \frac{\pi}{2}$$ as they wrote : $$\cos(\phi) = \cos\left(\frac{\theta}{2} - \frac{\pi}{2}\right)$$ and also : $$\sin(\phi) = -\sin\left(\frac{\pi}{2} - \frac{\theta}{2}\right)$$
which seems also logic and correct..
My question is : why do this problem seems to have 2 different solutions ? $\frac{\theta}{2} - \frac{\pi}{2}$ and $\frac{\theta}{2} + \frac{\pi}{2}$. What is the point that I am missing here ?
Thank you in advance for your help,
We can add the first two equations to get that $$\cos(\phi)+\sin(\phi)=\sin\left(\frac\theta2\right)-\cos\left(\frac\theta2\right)$$ We can combine the two trigonometric functions from each side to get $$\sqrt2\sin\left(\phi+\frac\pi4\right)=\sqrt2\sin\left(\frac\theta2-\frac\pi4\right)$$ Therefore we have $$\phi+\frac\pi4=\frac\theta2-\frac\pi4\Rightarrow\phi=\frac\theta2-\frac\pi2$$ or $$\phi+\frac\pi4=\pi-\left(\frac\theta2-\frac\pi4\right)\Rightarrow\phi=\pi-\frac\theta2$$ Although the $\pi-\frac\theta2$ solution is consistent with $\cos(\phi)+\sin(\phi)=\sin\left(\frac\theta2\right)-\cos\left(\frac\theta2\right)$, it is not consistent with $\cos(\phi)=\sin\left(\frac\theta2\right)$ or $\sin(\phi)=-\cos\left(\frac\theta2\right)$.
The only solution that works is $$\phi=\frac\theta2-\frac\pi2$$