15.8.21 problem 22

Internal problem ID [3024]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 12, page 46
Problem number : 22
Date solved : Sunday, March 30, 2025 at 01:10:55 AM
CAS classification : [_separable]

\begin{align*} y^{\prime }&=\cos \left (y\right ) \cos \left (x \right )^{2} \end{align*}

Maple. Time used: 0.051 (sec). Leaf size: 69
ode:=diff(y(x),x) = cos(y(x))*cos(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \arctan \left (\frac {c_1^{2} {\mathrm e}^{x +\frac {\sin \left (2 x \right )}{2}}-1}{c_1^{2} {\mathrm e}^{x +\frac {\sin \left (2 x \right )}{2}}+1}, \frac {2 c_1 \,{\mathrm e}^{\frac {x}{2}+\frac {\sin \left (2 x \right )}{4}}}{c_1^{2} {\mathrm e}^{x +\frac {\sin \left (2 x \right )}{2}}+1}\right ) \]
Mathematica. Time used: 0.995 (sec). Leaf size: 41
ode=D[y[x],x]==Cos[y[x]]*Cos[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to 2 \arctan \left (\tanh \left (\frac {1}{8} (2 x+\sin (2 x)+c_1)\right )\right ) \\ y(x)\to -\frac {\pi }{2} \\ y(x)\to \frac {\pi }{2} \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-cos(x)**2*cos(y(x)) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out