15.3.3 problem 3

Internal problem ID [2896]
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 : 3
Date solved : Sunday, March 30, 2025 at 12:48:34 AM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.186 (sec). Leaf size: 51
ode:=2*x-y(x)+1+(x+y(x))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {1}{3}+\frac {\tan \left (\operatorname {RootOf}\left (\sqrt {2}\, \ln \left (\left (3 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 ) \sqrt {2}\, \left (-3 x -1\right )}{3} \]
Mathematica. Time used: 0.099 (sec). Leaf size: 77
ode=(2*x-y[x]+1)+(x+y[x])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [2 \sqrt {2} \arctan \left (\frac {-y(x)+2 x+1}{\sqrt {2} (y(x)+x)}\right )=2 \log \left (\frac {6 x^2+3 y(x)^2-2 y(x)+4 x+1}{(3 x+1)^2}\right )+4 \log (3 x+1)+3 c_1,y(x)\right ] \]
Sympy. Time used: 4.261 (sec). Leaf size: 56
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*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}{3} \right )} = C_{1} - \log {\left (\sqrt {2 + \frac {\left (y{\left (x \right )} - \frac {1}{3}\right )^{2}}{\left (x + \frac {1}{3}\right )^{2}}} \right )} - \frac {\sqrt {2} \operatorname {atan}{\left (\frac {\sqrt {2} \left (y{\left (x \right )} - \frac {1}{3}\right )}{2 \left (x + \frac {1}{3}\right )} \right )}}{2} \]