36.1.15 problem 15

Internal problem ID [6270]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.2, Separable Equations. Exercises. page 46
Problem number : 15
Date solved : Wednesday, March 05, 2025 at 12:30:06 AM
CAS classification : [_separable]

\begin{align*} x +x y^{2}+{\mathrm e}^{x^{2}} y y^{\prime }&=0 \end{align*}

Maple. Time used: 0.006 (sec). Leaf size: 35
ode:=x+x*y(x)^2+exp(x^2)*y(x)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \sqrt {{\mathrm e}^{{\mathrm e}^{-x^{2}}} c_{1} -1} \\ y &= -\sqrt {{\mathrm e}^{{\mathrm e}^{-x^{2}}} c_{1} -1} \\ \end{align*}
Mathematica. Time used: 4.215 (sec). Leaf size: 65
ode=(x+x*y[x]^2)+Exp[x^2]*y[x]*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\sqrt {-1+e^{e^{-x^2}+2 c_1}} \\ y(x)\to \sqrt {-1+e^{e^{-x^2}+2 c_1}} \\ y(x)\to -i \\ y(x)\to i \\ \end{align*}
Sympy. Time used: 1.563 (sec). Leaf size: 36
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*y(x)**2 + x + y(x)*exp(x**2)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \sqrt {C_{1} e^{e^{- x^{2}}} - 1}, \ y{\left (x \right )} = \sqrt {C_{1} e^{e^{- x^{2}}} - 1}\right ] \]