7.7.28 problem 28

Internal problem ID [206]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 1. First order differential equations. Review problems at page 98
Problem number : 28
Date solved : Saturday, March 29, 2025 at 04:45:58 PM
CAS classification : [_linear]

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

Maple. Time used: 0.001 (sec). Leaf size: 14
ode:=x*diff(y(x),x)+y(x) = 2*exp(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {{\mathrm e}^{2 x}+c_1}{x} \]
Mathematica. Time used: 0.05 (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.228 (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} \]