30.6.36 problem 37

Internal problem ID [7571]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Review problems. page 79
Problem number : 37
Date solved : Tuesday, September 30, 2025 at 04:54:02 PM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

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

With initial conditions

\begin{align*} y \left (0\right )&=2 \\ \end{align*}
Maple. Time used: 0.484 (sec). Leaf size: 35
ode:=2*x-y(x)+(x+y(x)-3)*diff(y(x),x) = 0; 
ic:=[y(0) = 2]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = 2-\tan \left (\operatorname {RootOf}\left (\ln \left (\left (x -1\right )^{2} \sec \left (\textit {\_Z} \right )^{2}\right ) \sqrt {2}-2 \textit {\_Z} \right )\right ) \sqrt {2}\, \left (x -1\right ) \]
Mathematica. Time used: 0.083 (sec). Leaf size: 94
ode=(2*x-y[x] )+( x+y[x]-3 )*D[y[x],x]==0; 
ic={y[0]==2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [2 \sqrt {2} \arctan \left (\frac {2 x-y(x)}{\sqrt {2} (y(x)+x-3)}\right )+\log (9)=2 \sqrt {2} \arctan \left (\sqrt {2}\right )+2 \log \left (\frac {2 x^2+y(x)^2-4 y(x)-4 x+6}{(x-1)^2}\right )+4 \log (x-1)-4 i \pi +\log (9)-2 \log (2),y(x)\right ] \]
Sympy. Time used: 1.517 (sec). Leaf size: 54
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x + (x + y(x) - 3)*Derivative(y(x), x) - y(x),0) 
ics = {y(0): 2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \log {\left (x - 1 \right )} = - \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} + \frac {\log {\left (2 \right )}}{2} + i \pi \]