73.2.9 problem 3.4 i

Internal problem ID [14961]
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 : Monday, March 31, 2025 at 01:09:01 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.182 (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.441 (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} \]