23.1.22 problem 2(L)

Internal problem ID [4112]
Book : Theory and solutions of Ordinary Differential equations, Donald Greenspan, 1960
Section : Chapter 2. First order equations. Exercises at page 14
Problem number : 2(L)
Date solved : Sunday, March 30, 2025 at 02:18:28 AM
CAS classification : [[_homogeneous, `class A`], _rational, [_Abel, `2nd type`, `class A`]]

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

With initial conditions

\begin{align*} y \left (2\right )&=2 \end{align*}

Maple. Time used: 1.603 (sec). Leaf size: 81
ode:=diff(y(x),x) = (2*x-y(x))/(y(x)+2*x); 
ic:=y(2) = 2; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \operatorname {RootOf}\left (i \sqrt {17}\, \pi +2 \sqrt {17}\, \ln \left (2\right )+2 \sqrt {17}\, \operatorname {arctanh}\left (\frac {\left (2 \textit {\_Z} +3 x \right ) \sqrt {17}}{17 x}\right )-\sqrt {17}\, \ln \left (21+5 \sqrt {17}\right )+51 \ln \left (2\right )-17 \ln \left (\frac {\textit {\_Z}^{2}+3 \textit {\_Z} x -2 x^{2}}{x^{2}}\right )-34 \ln \left (x \right )\right ) \]
Mathematica. Time used: 0.111 (sec). Leaf size: 137
ode=D[y[x],x]==(2*x-y[x])/(2*x+y[x]); 
ic=y[2]==2; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\frac {1}{34} \left (\left (17+\sqrt {17}\right ) \log \left (-\frac {2 y(x)}{x}+\sqrt {17}-3\right )-\left (\sqrt {17}-17\right ) \log \left (\frac {2 y(x)}{x}+\sqrt {17}+3\right )\right )=-\log (x)+\frac {1}{34} i \left (17+\sqrt {17}\right ) \pi +\frac {1}{34} \left (34 \log (2)+17 \log \left (5-\sqrt {17}\right )+\sqrt {17} \log \left (5-\sqrt {17}\right )+17 \log \left (5+\sqrt {17}\right )-\sqrt {17} \log \left (5+\sqrt {17}\right )\right ),y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((-2*x + y(x))/(2*x + y(x)) + Derivative(y(x), x),0) 
ics = {y(2): 2} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out