83.8.2 problem 2

Internal problem ID [19057]
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 : Monday, March 31, 2025 at 06:42:11 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.018 (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 = \frac {\left (-b +a \right ) \operatorname {RootOf}\left (\textit {\_Z}^{2} a^{2}-2 \textit {\_Z}^{2} a b +\textit {\_Z}^{2} b^{2}-8 \textit {\_Z} a c_1 +8 \textit {\_Z} b c_1 +8 x \textit {\_Z} a -8 x \textit {\_Z} b +16 c_1^{2}-32 c_1 x -4 a b +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 \]