83.4.21 problem 21

Internal problem ID [19022]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Chapter II. Equations of first order and first degree. Exercise II (C) at page 12
Problem number : 21
Date solved : Monday, March 31, 2025 at 06:33:36 PM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.221 (sec). Leaf size: 33
ode:=diff(y(x),x) = (2*x-y(x)+1)/(x+2*y(x)-3); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-\sqrt {4+125 \left (x -\frac {1}{5}\right )^{2} c_1^{2}}+\left (-5 x +15\right ) c_1}{10 c_1} \]
Mathematica. Time used: 0.123 (sec). Leaf size: 65
ode=D[y[x],x]==(2*x-y[x]+1)/(x+2*y[x]-3); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {1}{2} \left (-\sqrt {5 x^2-2 x+9+4 c_1}-x+3\right ) \\ y(x)\to \frac {1}{2} \left (\sqrt {5 x^2-2 x+9+4 c_1}-x+3\right ) \\ \end{align*}
Sympy. Time used: 2.215 (sec). Leaf size: 48
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (2*x - y(x) + 1)/(x + 2*y(x) - 3),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \frac {x}{2} - \frac {\sqrt {C_{1} + 125 x^{2} - 50 x}}{10} + \frac {3}{2}, \ y{\left (x \right )} = - \frac {x}{2} + \frac {\sqrt {C_{1} + 125 x^{2} - 50 x}}{10} + \frac {3}{2}\right ] \]