32.6.6 problem Exercise 12.6, page 103

Internal problem ID [5871]
Book : Ordinary Differential Equations, By Tenenbaum and Pollard. Dover, NY 1963
Section : Chapter 2. Special types of differential equations of the first kind. Lesson 12, Miscellaneous Methods
Problem number : Exercise 12.6, page 103
Date solved : Tuesday, March 04, 2025 at 11:50:25 PM
CAS classification : [[_homogeneous, `class C`], _dAlembert]

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

Maple. Time used: 0.287 (sec). Leaf size: 27
ode:=(x-y(x))^2*diff(y(x),x) = 4; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right )+\ln \left (-x +y \left (x \right )-2\right )-\ln \left (-x +y \left (x \right )+2\right )-c_{1} = 0 \]
Mathematica. Time used: 0.223 (sec). Leaf size: 36
ode=(x-y[x])^2*D[y[x],x]==4; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [y(x)-4 \left (\frac {1}{4} \log (y(x)-x+2)-\frac {1}{4} \log (-y(x)+x+2)\right )=c_1,y(x)\right ] \]
Sympy. Time used: 1.015 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x - y(x))**2*Derivative(y(x), x) - 4,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ C_{1} + y{\left (x \right )} - \log {\left (x - y{\left (x \right )} - 2 \right )} + \log {\left (x - y{\left (x \right )} + 2 \right )} = 0 \]