8.6.28 problem 28

Internal problem ID [798]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Chapter 1 review problems. Page 78
Problem number : 28
Date solved : Saturday, March 29, 2025 at 10:28:48 PM
CAS classification : [_linear]

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

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