$\cos\big(\frac{dy}{dx}\big)=a$ where $a\in\mathbb{R}$ ; $y=2$ when $x=0$
The general solution given in my reference as : $y=x\cos^{-1}a+C$ and the particular solution : $\cos\big(\frac{y-2}{x}\big)=a$. But, is it a complete solution ?
Note: It is solved in my reference by taking $\cos^{-1}\big(\cos(\frac{dy}{dx})\big)=\frac{dy}{dx}$, but is it true always ?
My Attempt
$$ \cos\big(\frac{dy}{dx}\big)=a\implies \cos\big(\frac{dy}{dx}\big)=\cos\big(\cos^{-1}a\big)\\ 2n\pi\pm\frac{dy}{dx}=\cos^{-1}a\implies \pm{dy}=(2n\pi+\cos^{-1}a){dx}\\ \pm y=(2n\pi+\cos^{-1}a)x+C_1\\ y=\pm (2n\pi+\cos^{-1}a)x+C_2\\ \implies \color{red}{y=2n\pi x\pm x\cos^{-1}a+C_2} $$ At $x=0$, $$ C_2=2\\ y=2n\pi x\pm x\cos^{-1}a+2\\ \implies \cos\big(\frac{y-2}{x}\big)=\cos\big[2n\pi\pm\cos^{-1}a\big]=\cos\big[\cos^{-1}a\big]=a\\ \implies \color{red}{\cos\big(\frac{y-2}{x}\big)=a} $$
Can I say my general solution $y=2n\pi x\pm x\cos^{-1}a+C_2$ is complete, not the one in my reference ?
The solution is not unique due to the periodic nature of the $\cos$ function. Suppose $y_1$ and $y_2$ are two distinct solutions, then $\exists n$ such that
$$ \cos\left(\frac{dy_2}{dx}\right) = \cos\left(\pm\frac{dy_1}{dx}+2n\pi\right) = a $$
$$ \implies \frac{dy_2}{dx} \pm \frac{dy_1}{dx} = 2n\pi \implies y_2 \pm y_1 = 2n\pi x $$
So a more general solution would be
$$ y(x) = \left(\pm \cos^{-1}a + 2n\pi\right)x + 2 $$
It goes without saying that all of this is valid only when $a \in [-1,1]$