8.3.24 problem 25

Internal problem ID [700]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 1.4. Separable equations. Page 43
Problem number : 25
Date solved : Tuesday, March 04, 2025 at 11:33:06 AM
CAS classification : [_separable]

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

With initial conditions

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

Maple. Time used: 0.014 (sec). Leaf size: 14
ode:=-y(x)+x*diff(y(x),x) = 2*x^2*y(x); 
ic:=y(1) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = x \,{\mathrm e}^{\left (x -1\right ) \left (x +1\right )} \]
Mathematica. Time used: 0.029 (sec). Leaf size: 14
ode=-y[x]+x*D[y[x],x] == 2*x^2*y[x]; 
ic=y[1]==1; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{x^2-1} x \]
Sympy. Time used: 0.237 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*x**2*y(x) + x*Derivative(y(x), x) - y(x),0) 
ics = {y(1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x e^{x^{2}}}{e} \]