85.15.11 problem 2 (a)

Internal problem ID [22536]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter two. First order and simple higher order ordinary differential equations. A Exercises at page 47
Problem number : 2 (a)
Date solved : Thursday, October 02, 2025 at 08:48:34 PM
CAS classification : [[_homogeneous, `class A`], _rational, [_Abel, `2nd type`, `class A`]]

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

With initial conditions

\begin{align*} y \left (1\right )&=2 \\ \end{align*}
Maple. Time used: 0.119 (sec). Leaf size: 19
ode:=diff(y(x),x) = (y(x)-2*x)/(2*y(x)-x); 
ic:=[y(1) = 2]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {x}{2}+\frac {\sqrt {-3 x^{2}+12}}{2} \]
Mathematica. Time used: 0.308 (sec). Leaf size: 28
ode=D[y[x],x]==(y[x]-2*x)/(2*y[x]-x); 
ic={y[1]==2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{2} \left (\sqrt {3} \sqrt {4-x^2}+x\right ) \end{align*}
Sympy. Time used: 0.834 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-(-2*x + y(x))/(-x + 2*y(x)) + Derivative(y(x), x),0) 
ics = {y(1): 2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x}{2} + \frac {\sqrt {12 - 3 x^{2}}}{2} \]