30.5.19 problem 19

Internal problem ID [7518]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.6, Substitutions and Transformations. Exercises. page 76
Problem number : 19
Date solved : Tuesday, September 30, 2025 at 04:41:44 PM
CAS classification : [[_homogeneous, `class C`], _Riccati]

\begin{align*} y^{\prime }&=\left (x -y+5\right )^{2} \end{align*}
Maple. Time used: 0.008 (sec). Leaf size: 31
ode:=diff(y(x),x) = (x-y(x)+5)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (-x -4\right ) {\mathrm e}^{2 x}+c_1 \left (x +6\right )}{-{\mathrm e}^{2 x}+c_1} \]
Mathematica. Time used: 0.1 (sec). Leaf size: 29
ode=D[y[x],x]==(x-y[x]+5)^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to x+\frac {1}{\frac {1}{2}+c_1 e^{2 x}}+4\\ y(x)&\to x+4 \end{align*}
Sympy. Time used: 0.209 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-(x - y(x) + 5)**2 + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} x + 6 C_{1} - x e^{2 x} - 4 e^{2 x}}{C_{1} - e^{2 x}} \]