83.8.2 problem 2

Internal problem ID [19049]
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. Misc examples on chapter II at page 25
Problem number : 2
Date solved : Thursday, March 13, 2025 at 01:33:57 PM
CAS classification : [[_homogeneous, `class C`], _rational, _dAlembert]

\begin{align*} \frac {\left (x +y-a \right ) y^{\prime }}{x +y-b}&=\frac {x +y+a}{x +y+b} \end{align*}

Maple. Time used: 0.032 (sec). Leaf size: 81
ode:=(x+y(x)-a)/(x+y(x)-b)*diff(y(x),x) = (x+y(x)+a)/(x+y(x)+b); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {\left (-b +a \right ) \operatorname {RootOf}\left (a^{2} \textit {\_Z}^{2}-2 a \,\textit {\_Z}^{2} b +\textit {\_Z}^{2} b^{2}-8 a \textit {\_Z} c_{1} +8 b \textit {\_Z} c_{1} +8 x a \textit {\_Z} -8 x b \textit {\_Z} +16 c_{1}^{2}-32 c_{1} x -4 b a +16 x^{2}-4 \,{\mathrm e}^{\textit {\_Z}}\right )}{2}+x -2 c_{1} \]
Mathematica. Time used: 0.438 (sec). Leaf size: 33
ode=(x+y[x]-a)/(x+y[x]-b)*D[y[x],x]==(x+y[x]+a)/(x+y[x]+b); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [-\frac {1}{2} (a-b) \log \left ((y(x)+x)^2-a b\right )+y(x)-x=c_1,y(x)\right ] \]
Sympy. Time used: 3.482 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq((-a + x + y(x))*Derivative(y(x), x)/(-b + x + y(x)) - (a + x + y(x))/(b + x + y(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ C_{1} + \frac {x}{2} - \frac {\left (- a + b\right ) \log {\left (- a b + \left (- x - y{\left (x \right )}\right )^{2} \right )}}{4} - \frac {y{\left (x \right )}}{2} = 0 \]