63.4.13 problem 4(e)

Internal problem ID [12977]
Book : A First Course in Differential Equations by J. David Logan. Third Edition. Springer-Verlag, NY. 2015.
Section : Chapter 1, First order differential equations. Section 1.3.1 Separable equations. Exercises page 26
Problem number : 4(e)
Date solved : Wednesday, March 05, 2025 at 08:55:34 PM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }+y+\frac {1}{y}&=0 \end{align*}

Maple. Time used: 0.023 (sec). Leaf size: 29
ode:=diff(y(t),t)+y(t)+1/y(t) = 0; 
dsolve(ode,y(t), singsol=all);
 
\begin{align*} y &= \sqrt {c_{1} {\mathrm e}^{-2 t}-1} \\ y &= -\sqrt {c_{1} {\mathrm e}^{-2 t}-1} \\ \end{align*}
Mathematica. Time used: 2.44 (sec). Leaf size: 57
ode=D[y[t],t]+y[t]+1/y[t]==0; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)\to -\sqrt {-1+e^{-2 t+2 c_1}} \\ y(t)\to \sqrt {-1+e^{-2 t+2 c_1}} \\ y(t)\to -i \\ y(t)\to i \\ \end{align*}
Sympy. Time used: 0.416 (sec). Leaf size: 29
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(y(t) + Derivative(y(t), t) + 1/y(t),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ \left [ y{\left (t \right )} = - \sqrt {C_{1} e^{- 2 t} - 1}, \ y{\left (t \right )} = \sqrt {C_{1} e^{- 2 t} - 1}\right ] \]