56.1.2 problem 2

Internal problem ID [8714]
Book : Own collection of miscellaneous problems
Section : section 1.0
Problem number : 2
Date solved : Wednesday, March 05, 2025 at 06:13:20 AM
CAS classification : [_separable]

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

Maple. Time used: 0.003 (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.626 (sec). Leaf size: 33
ode=D[y[x],x] == x*(Cos[y[x]]+y[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ 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 ] \]
Sympy. Time used: 0.379 (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} \]