12.6.31 problem 40

Internal problem ID [1710]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Exact equations. Section 2.5 Page 79
Problem number : 40
Date solved : Saturday, March 29, 2025 at 11:35:32 PM
CAS classification : [[_Abel, `2nd type`, `class B`]]

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

With initial conditions

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

Maple. Time used: 0.190 (sec). Leaf size: 36
ode:=diff(y(x),x)+2*x*y(x) = -exp(-x^2)*(3*x+2*y(x)*exp(x^2))/(2*x+3*y(x)*exp(x^2)); 
ic:=y(0) = -1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -\frac {\left (2 x \,{\mathrm e}^{x^{2}}+\sqrt {{\mathrm e}^{2 x^{2}} \left (-5 x^{2}+9\right )}\right ) {\mathrm e}^{-2 x^{2}}}{3} \]
Mathematica. Time used: 33.12 (sec). Leaf size: 44
ode=D[y[x],x]+2*x*y[x]== -Exp[-x^2]*(3*x+2*y[x]*Exp[x^2])/(2*x+3*y[x]*Exp[x^2]); 
ic=y[0]==-1; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {1}{3} e^{-2 x^2} \left (2 e^{x^2} x+\sqrt {e^{2 x^2} \left (9-5 x^2\right )}\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*y(x) + Derivative(y(x), x) + (3*x + 2*y(x)*exp(x**2))*exp(-x**2)/(2*x + 3*y(x)*exp(x**2)),0) 
ics = {y(0): -1} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (-4*x**2*y(x)*exp(x**2) - 6*x*y(x)**2*exp(2*x**2) - 3*x - 2*y(x)*exp(x**2))*exp(-x**2)/(2*x + 3*y(x)*exp(x**2)) cannot be solved by the factorable group method