29.5.26 problem 143

Internal problem ID [4743]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 5
Problem number : 143
Date solved : Tuesday, March 04, 2025 at 07:13:32 PM
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 \left (x \right ) = -\frac {x}{2}+\frac {c_{1}}{x} \]
Mathematica. Time used: 0.025 (sec). Leaf size: 17
ode=x D[y[x],x]+x + y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {x}{2}+\frac {c_1}{x} \]
Sympy. Time used: 0.156 (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} \]