50.1.2 problem 2

Internal problem ID [10000]
Book : Own collection of miscellaneous problems
Section : section 1.0
Problem number : 2
Date solved : Tuesday, September 30, 2025 at 06:45:58 PM
CAS classification : [_separable]

\begin{align*} y^{\prime }&=x \left (\cos \left (y\right )+y\right ) \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 23
ode:=diff(y(x),x) = x*(cos(y(x))+y(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ \frac {x^{2}}{2}-\int _{}^{y}\frac {1}{\cos \left (\textit {\_a} \right )+\textit {\_a}}d \textit {\_a} +c_1 = 0 \]
Mathematica. Time used: 0.143 (sec). Leaf size: 33
ode=D[y[x],x] == x*(Cos[y[x]]+y[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {1}{\cos (K[1])+K[1]}dK[1]\&\right ]\left [\frac {x^2}{2}+c_1\right ] \end{align*}
Sympy. Time used: 0.227 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*(y(x) + cos(y(x))) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \int \limits ^{y{\left (x \right )}} \frac {1}{y + \cos {\left (y \right )}}\, dy = C_{1} + \frac {x^{2}}{2} \]