2.4.22 problem 22

Internal problem ID [725]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 1.5. Linear first order equations. Page 56
Problem number : 22
Date solved : Tuesday, September 30, 2025 at 04:07:13 AM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} y \left (0\right )&=5 \\ \end{align*}
Maple. Time used: 0.036 (sec). Leaf size: 14
ode:=diff(y(x),x) = 3*exp(x^2)*x^2+2*x*y(x); 
ic:=[y(0) = 5]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \left (x^{3}+5\right ) {\mathrm e}^{x^{2}} \]
Mathematica. Time used: 0.031 (sec). Leaf size: 16
ode=D[y[x],x] == 3*Exp[x^2]*x^2+2*x*y[x]; 
ic=y[0]==5; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{x^2} \left (x^3+5\right ) \end{align*}
Sympy. Time used: 0.160 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-3*x**2*exp(x**2) - 2*x*y(x) + Derivative(y(x), x),0) 
ics = {y(0): 5} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (x^{3} + 5\right ) e^{x^{2}} \]