19.2.3 problem 3

Internal problem ID [3532]
Book : Differential equations and linear algebra, Stephen W. Goode, second edition, 2000
Section : 1.6, page 50
Problem number : 3
Date solved : Sunday, March 30, 2025 at 01:46:20 AM
CAS classification : [_linear]

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

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