75.6.27 problem 160

Internal problem ID [16712]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Section 6. Linear equations of the first order. The Bernoulli equation. Exercises page 54
Problem number : 160
Date solved : Monday, March 31, 2025 at 03:07:12 PM
CAS classification : [_separable]

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

Maple. Time used: 0.001 (sec). Leaf size: 20
ode:=diff(y(x),x)+3*x*y(x) = y(x)*exp(x^2); 
dsolve(ode,y(x), singsol=all);
 
\[ y = c_1 \,{\mathrm e}^{-\frac {3 x^{2}}{2}+\frac {\sqrt {\pi }\, \operatorname {erfi}\left (x \right )}{2}} \]
Mathematica. Time used: 0.063 (sec). Leaf size: 33
ode=D[y[x],x]+3*x*y[x]==y[x]*Exp[x^2]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to c_1 e^{\frac {1}{2} \left (\sqrt {\pi } \text {erfi}(x)-3 x^2\right )} \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 0.405 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(3*x*y(x) - y(x)*exp(x**2) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- \frac {3 x^{2}}{2} + \frac {\sqrt {\pi } \operatorname {erfi}{\left (x \right )}}{2}} \]