73.3.18 problem 4.5 (b)

Internal problem ID [14981]
Book : Ordinary Differential Equations. An introduction to the fundamentals. Kenneth B. Howell. second edition. CRC Press. FL, USA. 2020
Section : Chapter 4. SEPARABLE FIRST ORDER EQUATIONS. Additional exercises. page 90
Problem number : 4.5 (b)
Date solved : Monday, March 31, 2025 at 01:10:04 PM
CAS classification : [_separable]

\begin{align*} y^{\prime }&=2 x -1+2 x y-y \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=2 \end{align*}

Maple. Time used: 0.020 (sec). Leaf size: 14
ode:=diff(y(x),x) = 2*x-1+2*x*y(x)-y(x); 
ic:=y(0) = 2; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -1+3 \,{\mathrm e}^{x \left (x -1\right )} \]
Mathematica. Time used: 0.056 (sec). Leaf size: 16
ode=D[y[x],x]==2*x-1+2*x*y[x]-y[x]; 
ic={y[0]==2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to 3 e^{(x-1) x}-1 \]
Sympy. Time used: 0.300 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*x*y(x) - 2*x + y(x) + Derivative(y(x), x) + 1,0) 
ics = {y(0): 2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 3 e^{x \left (x - 1\right )} - 1 \]