70.4.9 problem 9

Internal problem ID [18690]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 2. First order differential equations. Section 2.6 (Exact equations and integrating factors). Problems at page 100
Problem number : 9
Date solved : Thursday, October 02, 2025 at 03:20:44 PM
CAS classification : [_exact]

\begin{align*} 2 x -2 \,{\mathrm e}^{y x} \sin \left (2 x \right )+{\mathrm e}^{y x} \cos \left (2 x \right ) y+\left (-3+{\mathrm e}^{y x} x \cos \left (2 x \right )\right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.014 (sec). Leaf size: 35
ode:=y(x)*exp(x*y(x))*cos(2*x)-2*exp(x*y(x))*sin(2*x)+2*x+(x*exp(x*y(x))*cos(2*x)-3)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {x^{3}+c_1 x -3 \operatorname {LambertW}\left (-\frac {x \cos \left (2 x \right ) {\mathrm e}^{\frac {x \left (x^{2}+c_1 \right )}{3}}}{3}\right )}{3 x} \]
Mathematica. Time used: 3.638 (sec). Leaf size: 48
ode=(y[x]*Exp[x*y[x]]*Cos[2*x]-2*Exp[x*y[x]]*Sin[2*x]+2*x)+(x*Exp[x*y[x]]*Cos[2*x]-3)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {-3 W\left (-\frac {1}{3} x e^{\frac {1}{3} x \left (x^2-c_1\right )} \cos (2 x)\right )+x^3-c_1 x}{3 x} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x + (x*exp(x*y(x))*cos(2*x) - 3)*Derivative(y(x), x) + y(x)*exp(x*y(x))*cos(2*x) - 2*exp(x*y(x))*sin(2*x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out