15.3.4 problem 4

Internal problem ID [2897]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 7, page 28
Problem number : 4
Date solved : Sunday, March 30, 2025 at 12:48:40 AM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

\begin{align*} x -y+2+\left (x +y-1\right ) y^{\prime }&=0 \end{align*}

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