30.6.17 problem 18

Internal problem ID [7552]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Review problems. page 79
Problem number : 18
Date solved : Tuesday, September 30, 2025 at 04:47:15 PM
CAS classification : [[_homogeneous, `class C`], _Riccati]

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