40.3.8 problem 23 (m)

Internal problem ID [6612]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 5. Equations of first order and first degree (Exact equations). Supplemetary problems. Page 33
Problem number : 23 (m)
Date solved : Wednesday, March 05, 2025 at 01:30:51 AM
CAS classification : [[_homogeneous, `class C`], _exact, _rational, [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.094 (sec). Leaf size: 30
ode:=x+y(x)+1-(y(x)-x+3)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-\sqrt {2 \left (x -1\right )^{2} c_1^{2}+1}+\left (x -3\right ) c_1}{c_1} \]
Mathematica. Time used: 0.138 (sec). Leaf size: 59
ode=(x+y[x]+1)-(y[x]-x+3)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -i \sqrt {-2 x^2+4 x-9-c_1}+x-3 \\ y(x)\to i \sqrt {-2 x^2+4 x-9-c_1}+x-3 \\ \end{align*}
Sympy. Time used: 1.873 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x - (-x + y(x) + 3)*Derivative(y(x), x) + y(x) + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = x - \sqrt {C_{1} + 2 x^{2} - 4 x} - 3, \ y{\left (x \right )} = x + \sqrt {C_{1} + 2 x^{2} - 4 x} - 3\right ] \]