44.6.23 problem 23

Internal problem ID [7167]
Book : A First Course in Differential Equations with Modeling Applications by Dennis G. Zill. 12 ed. Metric version. 2024. Cengage learning.
Section : Chapter 2. First order differential equations. Section 2.3 Linear equations. Exercises 2.3 at page 63
Problem number : 23
Date solved : Wednesday, March 05, 2025 at 04:19:41 AM
CAS classification : [_linear]

\begin{align*} x y^{\prime }+\left (3 x +1\right ) y&={\mathrm e}^{-3 x} \end{align*}

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