30.5.18 problem 18

Internal problem ID [7517]
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 : 18
Date solved : Tuesday, September 30, 2025 at 04:41:41 PM
CAS classification : [[_homogeneous, `class C`], _Riccati]

\begin{align*} y^{\prime }&=\left (x +y+2\right )^{2} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 17
ode:=diff(y(x),x) = (x+y(x)+2)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -x -2-\tan \left (-x +c_1 \right ) \]
Mathematica. Time used: 0.331 (sec). Leaf size: 15
ode=D[y[x],x]==(x+y[x]+2)^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -x+\tan (x+c_1)-2 \end{align*}
Sympy. Time used: 0.228 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-(x + y(x) + 2)**2 + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {- C_{1} x + C_{1} \left (-2 + i\right ) + x e^{2 i x} + \left (2 + i\right ) e^{2 i x}}{C_{1} - e^{2 i x}} \]