30.1.2 problem Example, page 27

Internal problem ID [5690]
Book : Differential and integral calculus, vol II By N. Piskunov. 1974
Section : Chapter 1
Problem number : Example, page 27
Date solved : Tuesday, March 04, 2025 at 11:25:07 PM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.051 (sec). Leaf size: 32
ode:=diff(y(x),x) = (x+y(x)-3)/(x-y(x)-1); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = 1+\tan \left (\operatorname {RootOf}\left (2 \textit {\_Z} +\ln \left (\sec \left (\textit {\_Z} \right )^{2}\right )+2 \ln \left (x -2\right )+2 c_{1} \right )\right ) \left (-x +2\right ) \]
Mathematica. Time used: 0.063 (sec). Leaf size: 57
ode=D[y[x],x]==(x+y[x]-3)/(x-y[x]-1); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [2 \arctan \left (\frac {y(x)+x-3}{-y(x)+x-1}\right )=\log \left (\frac {x^2+y(x)^2-2 y(x)-4 x+5}{2 (x-2)^2}\right )+2 \log (x-2)+c_1,y(x)\right ] \]
Sympy. Time used: 3.593 (sec). Leaf size: 34
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (x + y(x) - 3)/(x - y(x) - 1),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \log {\left (x - 2 \right )} = C_{1} - \log {\left (\sqrt {1 + \frac {\left (y{\left (x \right )} - 1\right )^{2}}{\left (x - 2\right )^{2}}} \right )} + \operatorname {atan}{\left (\frac {y{\left (x \right )} - 1}{x - 2} \right )} \]