73.4.29 problem 5.4 (c)

Internal problem ID [15040]
Book : Ordinary Differential Equations. An introduction to the fundamentals. Kenneth B. Howell. second edition. CRC Press. FL, USA. 2020
Section : Chapter 5. LINEAR FIRST ORDER EQUATIONS. Additional exercises. page 103
Problem number : 5.4 (c)
Date solved : Monday, March 31, 2025 at 01:13:49 PM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} y \left (3\right )&=8 \end{align*}

Maple. Time used: 0.067 (sec). Leaf size: 20
ode:=-y(x)+x*diff(y(x),x) = x^2*exp(-x^2); 
ic:=y(3) = 8; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -\frac {\left (-\frac {16}{3}+\left (\operatorname {erf}\left (3\right )-\operatorname {erf}\left (x \right )\right ) \sqrt {\pi }\right ) x}{2} \]
Mathematica. Time used: 0.081 (sec). Leaf size: 30
ode=x*D[y[x],x]-y[x]==x^2*Exp[-x^2]; 
ic={y[3]==8}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{6} x \left (3 \sqrt {\pi } \text {erf}(x)-3 \sqrt {\pi } \text {erf}(3)+16\right ) \]
Sympy. Time used: 0.434 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*exp(-x**2) + x*Derivative(y(x), x) - y(x),0) 
ics = {y(3): 8} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \left (\frac {\sqrt {\pi } \operatorname {erf}{\left (x \right )}}{2} - \frac {\sqrt {\pi } \operatorname {erf}{\left (3 \right )}}{2} + \frac {8}{3}\right ) \]