64.5.4 problem 4

Internal problem ID [13246]
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 : 4
Date solved : Monday, March 31, 2025 at 07:43:21 AM
CAS classification : [_separable]

\begin{align*} y^{\prime }+4 x y&=8 x \end{align*}

Maple. Time used: 0.001 (sec). Leaf size: 14
ode:=diff(y(x),x)+4*x*y(x) = 8*x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = 2+{\mathrm e}^{-2 x^{2}} c_1 \]
Mathematica. Time used: 0.037 (sec). Leaf size: 22
ode=D[y[x],x]+4*x*y[x]==8*x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to 2+c_1 e^{-2 x^2} \\ y(x)\to 2 \\ \end{align*}
Sympy. Time used: 0.293 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*x*y(x) - 8*x + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- 2 x^{2}} + 2 \]