36.2.12 problem 12

Internal problem ID [6305]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.3, Linear equations. Exercises. page 54
Problem number : 12
Date solved : Wednesday, March 05, 2025 at 12:33:29 AM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }&=x^{2} {\mathrm e}^{-4 x}-4 y \end{align*}

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