67.2.9 problem 3.4 i

Internal problem ID [16319]
Book : Ordinary Differential Equations. An introduction to the fundamentals. Kenneth B. Howell. second edition. CRC Press. FL, USA. 2020
Section : Chapter 3. Some basics about First order equations. Additional exercises. page 63
Problem number : 3.4 i
Date solved : Thursday, October 02, 2025 at 01:18:50 PM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }+2 y-y^{2}&=-2 \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 19
ode:=diff(y(x),x)+2*y(x)-y(x)^2 = -2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = 1-\sqrt {3}\, \tanh \left (\left (c_1 +x \right ) \sqrt {3}\right ) \]
Mathematica. Time used: 0.104 (sec). Leaf size: 55
ode=D[y[x],x]+2*y[x]-y[x]^2==-2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {1}{K[1]^2-2 K[1]-2}dK[1]\&\right ][x+c_1]\\ y(x)&\to 1-\sqrt {3}\\ y(x)&\to 1+\sqrt {3} \end{align*}
Sympy. Time used: 0.295 (sec). Leaf size: 39
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x)**2 + 2*y(x) + Derivative(y(x), x) + 2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ x + \frac {\sqrt {3} \log {\left (y{\left (x \right )} - 1 + \sqrt {3} \right )}}{6} - \frac {\sqrt {3} \log {\left (y{\left (x \right )} - \sqrt {3} - 1 \right )}}{6} = C_{1} \]