74.6.40 problem 41

Internal problem ID [15992]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 2. First Order Equations. Exercises 2.4, page 57
Problem number : 41
Date solved : Monday, March 31, 2025 at 02:22:59 PM
CAS classification : [_exact]

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

With initial conditions

\begin{align*} y \left (0\right )&=0 \end{align*}

Maple. Time used: 0.191 (sec). Leaf size: 25
ode:=-2*x-y(x)*cos(x*y(x))+(2*y(x)-x*cos(x*y(x)))*diff(y(x),x) = 0; 
ic:=y(0) = 0; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {\operatorname {RootOf}\left (-x^{4}-\sin \left (\textit {\_Z} \right ) x^{2}+\textit {\_Z}^{2}\right )}{x} \]
Mathematica. Time used: 0.235 (sec). Leaf size: 75
ode=(-2*x-y[x]*Cos[x*y[x]])+(2*y[x]-x*Cos[x*y[x]])*D[y[x],x]==0; 
ic={y[0]==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\int _0^x(2 K[1]+\cos (K[1] y(x)) y(x))dK[1]+\int _0^{y(x)}\left (x \cos (x K[2])-2 K[2]-\int _0^x(\cos (K[1] K[2])-K[1] K[2] \sin (K[1] K[2]))dK[1]\right )dK[2]=0,y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*x + (-x*cos(x*y(x)) + 2*y(x))*Derivative(y(x), x) - y(x)*cos(x*y(x)),0) 
ics = {y(0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out