83.4.22 problem 22

Internal problem ID [19023]
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. Exercise II (C) at page 12
Problem number : 22
Date solved : Monday, March 31, 2025 at 06:33:40 PM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.013 (sec). Leaf size: 34
ode:=(x-y(x))*diff(y(x),x) = x+y(x)+1; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {1}{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.05 (sec). Leaf size: 61
ode=(x-y[x])*D[y[x],x]==(x+y[x]+1); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [2 \arctan \left (\frac {y(x)+x+1}{x-y(x)}\right )=\log \left (\frac {2 x^2+2 y(x)^2+2 y(x)+2 x+1}{(2 x+1)^2}\right )+2 \log (2 x+1)+c_1,y(x)\right ] \]
Sympy. Time used: 4.499 (sec). Leaf size: 42
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x + (x - y(x))*Derivative(y(x), x) - y(x) - 1,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 {1}{2}\right )^{2}}{\left (x + \frac {1}{2}\right )^{2}}} \right )} + \operatorname {atan}{\left (\frac {y{\left (x \right )} + \frac {1}{2}}{x + \frac {1}{2}} \right )} \]