44.4.5 problem 5

Internal problem ID [9140]
Book : Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section : Chapter 1. What is a differential equation. Section 1.5. Exact Equations. Page 20
Problem number : 5
Date solved : Tuesday, September 30, 2025 at 06:06:52 PM
CAS classification : [_separable]

\begin{align*} y+y \cos \left (x y\right )+\left (x +x \cos \left (x y\right )\right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.009 (sec). Leaf size: 17
ode:=y(x)+y(x)*cos(x*y(x))+(x+x*cos(x*y(x)))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \frac {\pi }{x} \\ y &= \frac {c_1}{x} \\ \end{align*}
Mathematica. Time used: 0.019 (sec). Leaf size: 49
ode=(y[x]+y[x]*Cos[x*y[x]])+(x+x*Cos[x*y[x]])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {\pi }{x}\\ y(x)&\to \frac {\pi }{x}\\ y(x)&\to \frac {c_1}{x}\\ y(x)&\to -\frac {\pi }{x}\\ y(x)&\to \frac {\pi }{x} \end{align*}
Sympy. Time used: 0.156 (sec). Leaf size: 5
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x*cos(x*y(x)) + x)*Derivative(y(x), x) + y(x)*cos(x*y(x)) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1}}{x} \]