58.5.20 problem 20

Internal problem ID [14614]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 2, section 2.3 (Linear equations). Exercises page 56
Problem number : 20
Date solved : Thursday, October 02, 2025 at 09:44:22 AM
CAS classification : [_separable]

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

With initial conditions

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