12.2.24 problem 24

Internal problem ID [1560]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Linear first order. Section 2.1 Page 41
Problem number : 24
Date solved : Saturday, March 29, 2025 at 10:59:08 PM
CAS classification : [_linear]

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

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