21.1.9 problem 9

Internal problem ID [4085]
Book : Differential equations, Shepley L. Ross, 1964
Section : 2.4, page 55
Problem number : 9
Date solved : Sunday, March 30, 2025 at 02:16:53 AM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

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

With initial conditions

\begin{align*} y \left (2\right )&=-2 \end{align*}

Maple. Time used: 1.497 (sec). Leaf size: 51
ode:=3*x-y(x)-6+(x+y(x)+2)*diff(y(x),x) = 0; 
ic:=y(2) = -2; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -3-\tan \left (\operatorname {RootOf}\left (-3 \sqrt {3}\, \ln \left (\left (x -1\right )^{2} \sec \left (\textit {\_Z} \right )^{2}\right )+6 \sqrt {3}\, \ln \left (2\right )-3 \sqrt {3}\, \ln \left (3\right )+\pi +6 \textit {\_Z} \right )\right ) \sqrt {3}\, \left (x -1\right ) \]
Mathematica. Time used: 0.138 (sec). Leaf size: 90
ode=(3*x-y[x]-6)+(x+y[x]+2)*D[y[x],x]==0; 
ic=y[2]==-2; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\frac {\arctan \left (\frac {-y(x)+3 x-6}{\sqrt {3} (y(x)+x+2)}\right )}{\sqrt {3}}+\log (2)=\frac {1}{2} \log \left (\frac {3 x^2+y(x)^2+6 y(x)-6 x+12}{(x-1)^2}\right )+\log (x-1)+\frac {1}{18} \left (\sqrt {3} \pi +18 \log (2)-9 \log (4)\right ),y(x)\right ] \]
Sympy. Time used: 4.887 (sec). Leaf size: 58
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(3*x + (x + y(x) + 2)*Derivative(y(x), x) - y(x) - 6,0) 
ics = {y(2): -2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \log {\left (x - 1 \right )} = - \log {\left (\sqrt {3 + \frac {\left (y{\left (x \right )} + 3\right )^{2}}{\left (x - 1\right )^{2}}} \right )} - \frac {\sqrt {3} \operatorname {atan}{\left (\frac {\sqrt {3} \left (y{\left (x \right )} + 3\right )}{3 \left (x - 1\right )} \right )}}{3} + \frac {\sqrt {3} \pi }{18} + \log {\left (2 \right )} \]