23.1.145 problem 146

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

\begin{align*} x y^{\prime }+x +y&=0 \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 13
ode:=x*diff(y(x),x)+x+y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {x}{2}+\frac {c_1}{x} \]
Mathematica. Time used: 0.015 (sec). Leaf size: 17
ode=x*D[y[x],x]+x + y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {x}{2}+\frac {c_1}{x} \end{align*}
Sympy. Time used: 0.094 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) + x + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1}}{x} - \frac {x}{2} \]