23.1.160 problem 160

Internal problem ID [4767]
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 : 160
Date solved : Tuesday, September 30, 2025 at 08:30:56 AM
CAS classification : [_linear]

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