20.5.7 problem Problem 7

Internal problem ID [3690]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.9, Exact Differential Equations. page 91
Problem number : Problem 7
Date solved : Sunday, March 30, 2025 at 02:05:49 AM
CAS classification : [_exact, [_1st_order, `_with_symmetry_[F(x),G(x)]`]]

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

Maple. Time used: 0.007 (sec). Leaf size: 115
ode:=4*exp(2*x)+2*x*y(x)-y(x)^2+(x-y(x))^2*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \left (-x^{3}-6 \,{\mathrm e}^{2 x}-3 c_1 \right )^{{1}/{3}}+x \\ y &= -\frac {\left (-x^{3}-6 \,{\mathrm e}^{2 x}-3 c_1 \right )^{{1}/{3}}}{2}-\frac {i \sqrt {3}\, \left (-x^{3}-6 \,{\mathrm e}^{2 x}-3 c_1 \right )^{{1}/{3}}}{2}+x \\ y &= -\frac {\left (-x^{3}-6 \,{\mathrm e}^{2 x}-3 c_1 \right )^{{1}/{3}}}{2}+\frac {i \sqrt {3}\, \left (-x^{3}-6 \,{\mathrm e}^{2 x}-3 c_1 \right )^{{1}/{3}}}{2}+x \\ \end{align*}
Mathematica. Time used: 1.433 (sec). Leaf size: 112
ode=(4*Exp[2*x]+2*x*y[x]-y[x]^2)+(x-y[x])^2*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to x+\sqrt [3]{-x^3-6 e^{2 x}+3 c_1} \\ y(x)\to x+\frac {1}{2} i \left (\sqrt {3}+i\right ) \sqrt [3]{-x^3-6 e^{2 x}+3 c_1} \\ y(x)\to x-\frac {1}{2} \left (1+i \sqrt {3}\right ) \sqrt [3]{-x^3-6 e^{2 x}+3 c_1} \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*y(x) + (x - y(x))**2*Derivative(y(x), x) - y(x)**2 + 4*exp(2*x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out