Ordinary Differential Equations – Solving dy/dx=cos(x)cos(y)

algebra-precalculusordinary differential equations

I've been trying to solve the following differential equation:
$$\frac{dy}{dx}=\cos{x}\cos{y}$$
but I can't seem to figure it out. Here are the steps I've taken:

  1. Separate the variables onto their own sides of the equation:
    $$\sec y \,dy = \cos x\,dx$$
  2. Integrate both sides of the equation:
    $$\ln|\sec y + \tan y| = \sin x + C$$
  3. Eliminate natural logarithm on LHS:
    $$|\sec y + \tan y| = Ce^{\sin x}$$

My solution is supposed to be in the form $y=f(x)$. However, now, there's no way to a solution (that I can see). Am I missing some obvious algebra, or did I mess up an earlier step? Thanks!

Best Answer

Note that there is another less known anti-derivative of $\sec(y)$ than $\ln|\sec y + \tan y|$

Indeed remember $\tan(u)'=1+\tan(u)^2$ and $\operatorname{arctanh}(u)'=\dfrac 1{1-u^2}$

And the half angle formula for $\cos(y)=\dfrac{1-t^2}{1+t^2}$ for $t=\tan(y/2)$

Therefore $\Big(2\operatorname{arctanh}(\tan(y/2))\Big)'=2\times\frac 12\times\dfrac{1+\tan(y/2)^2}{1-\tan(y/2)^2}=\dfrac 1{\cos(y)}=\sec(y)$

And this is LHS is easy to invert (get $y$ in function of $\sin x$).