89.1.18 problem 18

Internal problem ID [24253]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 2. Equations of the first order and first degree. Exercises at page 21
Problem number : 18
Date solved : Thursday, October 02, 2025 at 10:02:06 PM
CAS classification : [_separable]

\begin{align*} \cos \left (y\right )&=x y^{\prime } \end{align*}
Maple. Time used: 0.006 (sec). Leaf size: 41
ode:=cos(y(x)) = x*diff(y(x),x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \arctan \left (\frac {c_1^{2} x^{2}-1}{c_1^{2} x^{2}+1}, \frac {2 x c_1}{c_1^{2} x^{2}+1}\right ) \]
Mathematica. Time used: 0.15 (sec). Leaf size: 36
ode=Cos[y[x]] == x*D[y[x],x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to 2 \arctan \left (\tanh \left (\frac {1}{2} (\log (x)+c_1)\right )\right )\\ y(x)&\to -\frac {\pi }{2}\\ y(x)&\to \frac {\pi }{2} \end{align*}
Sympy. Time used: 0.758 (sec). Leaf size: 49
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*Derivative(y(x), x) + cos(y(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \pi - \operatorname {asin}{\left (\frac {x^{2} e^{2 C_{1}} + 1}{x^{2} e^{2 C_{1}} - 1} \right )}, \ y{\left (x \right )} = \operatorname {asin}{\left (\frac {x^{2} e^{2 C_{1}} + 1}{x^{2} e^{2 C_{1}} - 1} \right )}\right ] \]