62.4.2 problem Ex 2

Internal problem ID [12743]
Book : An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section : Chapter 2, differential equations of the first order and the first degree. Article 11. Equations in which M and N are linear but not homogeneous. Page 16
Problem number : Ex 2
Date solved : Monday, March 31, 2025 at 07:01:29 AM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.010 (sec). Leaf size: 36
ode:=4*x-y(x)+2+(x+y(x)+3)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -2+\left (-2 x -2\right ) \tan \left (\operatorname {RootOf}\left (2 \ln \left (2\right )+\ln \left (\sec \left (\textit {\_Z} \right )^{2}\right )-\textit {\_Z} +2 \ln \left (x +1\right )+2 c_1 \right )\right ) \]
Mathematica. Time used: 0.062 (sec). Leaf size: 67
ode=(4*x-y[x]+2)+(x+y[x]+3)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [2 \arctan \left (\frac {1}{2}-\frac {5 (x+1)}{2 (y(x)+x+3)}\right )+2 \log \left (\frac {4 x^2+y(x)^2+4 y(x)+8 x+8}{5 (x+1)^2}\right )+4 \log (x+1)+5 c_1=0,y(x)\right ] \]
Sympy. Time used: 1.955 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*x + (x + y(x) + 3)*Derivative(y(x), x) - y(x) + 2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \log {\left (x + 1 \right )} = C_{1} - \log {\left (\sqrt {4 + \frac {\left (y{\left (x \right )} + 2\right )^{2}}{\left (x + 1\right )^{2}}} \right )} - \frac {\operatorname {atan}{\left (\frac {y{\left (x \right )} + 2}{2 \left (x + 1\right )} \right )}}{2} \]