89.10.18 problem 18

Internal problem ID [24511]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 4. Additional topics on equations of first order and first degree. Exercises at page 77
Problem number : 18
Date solved : Thursday, October 02, 2025 at 10:44:07 PM
CAS classification : [[_homogeneous, `class C`], _dAlembert]

\begin{align*} 4+\left (x -y+2\right )^{2} y^{\prime }&=0 \end{align*}
Maple. Time used: 0.010 (sec). Leaf size: 22
ode:=4+(x-y(x)+2)^2*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -2 \operatorname {RootOf}\left (-2 \textit {\_Z} +c_1 -x +2 \tan \left (\textit {\_Z} \right )-2\right )+c_1 \]
Mathematica. Time used: 0.15 (sec). Leaf size: 44
ode=( 4 )+ ( x-y[x]+2 )^2*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [4 \left (\frac {1}{4} \arctan \left (\frac {1}{2} (-y(x)+x+2)\right )-\frac {1}{4} \arctan \left (\frac {1}{2} (y(x)-x-2)\right )\right )+y(x)=c_1,y(x)\right ] \]
Sympy. Time used: 0.687 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x - y(x) + 2)**2*Derivative(y(x), x) + 4,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ C_{1} + y{\left (x \right )} + 2 \operatorname {atan}{\left (\frac {x}{2} - \frac {y{\left (x \right )}}{2} + 1 \right )} = 0 \]