47.2.28 problem 28

Internal problem ID [7444]
Book : Ordinary differential equations and calculus of variations. Makarets and Reshetnyak. Wold Scientific. Singapore. 1995
Section : Chapter 1. First order differential equations. Section 1.2 Homogeneous equations problems. page 12
Problem number : 28
Date solved : Sunday, March 30, 2025 at 12:06:54 PM
CAS classification : [_linear]

\begin{align*} y^{\prime }+\frac {x +2 y}{x}&=0 \end{align*}

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