23.1.264 problem 258

Internal problem ID [4871]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 258
Date solved : Tuesday, September 30, 2025 at 08:45:50 AM
CAS classification : [_linear]

\begin{align*} x^{2} y^{\prime }+x \left (2+x \right ) y&=x \left (1-{\mathrm e}^{-2 x}\right )-2 \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 27
ode:=x^2*diff(y(x),x)+x*(x+2)*y(x) = x*(1-exp(-2*x))-2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-3+{\mathrm e}^{-2 x}+x \,{\mathrm e}^{-2 x}+x +{\mathrm e}^{-x} c_1}{x^{2}} \]
Mathematica. Time used: 0.365 (sec). Leaf size: 50
ode=x^2*D[y[x],x]+x*(2+x)*y[x]==x*(1-Exp[-2*x])-2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {e^{-x-2} \left (\int _1^x\left (e^{K[1]+2} (K[1]-2)-e^{2-K[1]} K[1]\right )dK[1]+c_1\right )}{x^2} \end{align*}
Sympy. Time used: 0.283 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) - x*(1 - exp(-2*x)) + x*(x + 2)*y(x) + 2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {\frac {C_{1} e^{- x}}{x} + 1 + e^{- 2 x} - \frac {3}{x} + \frac {e^{- 2 x}}{x}}{x} \]