7.4.3 problem 3

Internal problem ID [75]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 1. First order differential equations. Section 1.5 (linear equations). Problems at page 54
Problem number : 3
Date solved : Tuesday, March 04, 2025 at 10:42:07 AM
CAS classification : [[_linear, `class A`]]

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

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