87.6.14 problem 17

Internal problem ID [23331]
Book : Ordinary differential equations with modern applications. Ladas, G. E. and Finizio, N. Wadsworth Publishing. California. 1978. ISBN 0-534-00552-7. QA372.F56
Section : Chapter 1. Elementary methods. First order differential equations. Exercise at page 53
Problem number : 17
Date solved : Thursday, October 02, 2025 at 09:37:33 PM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

\begin{align*} y^{\prime }&=\frac {2 x +y-4}{x -y+1} \end{align*}
Maple. Time used: 0.159 (sec). Leaf size: 47
ode:=diff(y(x),x) = (2*x+y(x)-4)/(x-y(x)+1); 
dsolve(ode,y(x), singsol=all);
 
\[ y = 2-\tan \left (\operatorname {RootOf}\left (\sqrt {2}\, \ln \left (\left (x -1\right )^{2} \sec \left (\textit {\_Z} \right )^{2}\right )+\sqrt {2}\, \ln \left (2\right )+2 \sqrt {2}\, c_1 +2 \textit {\_Z} \right )\right ) \left (x -1\right ) \sqrt {2} \]
Mathematica. Time used: 0.063 (sec). Leaf size: 75
ode=D[y[x],x]==(2*x+y[x]-4)/(x-y[x]+1); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [2 \sqrt {2} \arctan \left (\frac {y(x)+2 x-4}{\sqrt {2} (-y(x)+x+1)}\right )+\log (9)=2 \log \left (\frac {2 x^2+y(x)^2-4 y(x)-4 x+6}{(x-1)^2}\right )+4 \log (x-1)+3 c_1,y(x)\right ] \]
Sympy. Time used: 1.250 (sec). Leaf size: 48
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (2*x + y(x) - 4)/(x - y(x) + 1),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \log {\left (x - 1 \right )} = C_{1} - \log {\left (\sqrt {2 + \frac {\left (y{\left (x \right )} - 2\right )^{2}}{\left (x - 1\right )^{2}}} \right )} + \frac {\sqrt {2} \operatorname {atan}{\left (\frac {\sqrt {2} \left (y{\left (x \right )} - 2\right )}{2 \left (x - 1\right )} \right )}}{2} \]