64.5.18 problem 18

Internal problem ID [13260]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 2, section 2.3 (Linear equations). Exercises page 56
Problem number : 18
Date solved : Monday, March 31, 2025 at 07:44:04 AM
CAS classification : [_separable]

\begin{align*} x^{\prime }+\frac {\left (t +1\right ) x}{2 t}&=\frac {t +1}{x t} \end{align*}

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