60.1.211 problem 215

Internal problem ID [10225]
Book : Differential Gleichungen, E. Kamke, 3rd ed. Chelsea Pub. NY, 1948
Section : Chapter 1, linear first order
Problem number : 215
Date solved : Sunday, March 30, 2025 at 03:32:38 PM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

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

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