68.4.64 problem 61 (a)

Internal problem ID [17244]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 2. First Order Equations. Exercises 2.2, page 39
Problem number : 61 (a)
Date solved : Thursday, October 02, 2025 at 01:59:48 PM
CAS classification : [[_homogeneous, `class C`], _Riccati]

\begin{align*} y^{\prime }&=\left (x +y-4\right )^{2} \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 17
ode:=diff(y(x),x) = (x+y(x)-4)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -x +4-\tan \left (-x +c_1 \right ) \]
Mathematica. Time used: 0.106 (sec). Leaf size: 41
ode=D[y[x],x]==(x+y[x]-4)^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -x+\frac {1}{c_1 e^{2 i x}-\frac {i}{2}}+(4-i)\\ y(x)&\to -x+(4-i) \end{align*}
Sympy. Time used: 0.220 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-(x + y(x) - 4)**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 (4 + i\right ) + x e^{2 i x} + \left (-4 + i\right ) e^{2 i x}}{C_{1} - e^{2 i x}} \]