87.6.21 problem 24

Internal problem ID [23338]
Book : Ordinary differential equations with modern applications. Ladas, G. E. and Finizio, N. Wadsworth Publishing. California. 1978. ISBN 0-534-00552-7. QA372.F56
Section : Chapter 1. Elementary methods. First order differential equations. Exercise at page 53
Problem number : 24
Date solved : Thursday, October 02, 2025 at 09:38:44 PM
CAS classification : [[_homogeneous, `class A`], _rational, [_Abel, `2nd type`, `class A`]]

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

With initial conditions

\begin{align*} y \left (1\right )&=1 \\ \end{align*}
Maple. Time used: 0.199 (sec). Leaf size: 35
ode:=diff(y(x),x) = -(2*y(x)+x)/y(x); 
ic:=[y(1) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -\frac {x \left (\operatorname {LambertW}\left (-\frac {x \,{\mathrm e}^{2 i \pi \_Z1 -\frac {1}{2}}}{2}\right )+1\right )}{\operatorname {LambertW}\left (-\frac {x \,{\mathrm e}^{2 i \pi \_Z1 -\frac {1}{2}}}{2}\right )} \]
Mathematica. Time used: 0.113 (sec). Leaf size: 39
ode=D[y[x],x]==-(x+2*y[x])/y[x]; 
ic={y[1]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\frac {1}{\frac {y(x)}{x}+1}+\log \left (\frac {y(x)}{x}+1\right )=\frac {1}{2} (1+2 \log (2))-\log (x),y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((-x - 2*y(x))/y(x) + Derivative(y(x), x),0) 
ics = {y(1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
RecursionError : maximum recursion depth exceeded