63.12.3 problem 1(c)

Internal problem ID [13086]
Book : A First Course in Differential Equations by J. David Logan. Third Edition. Springer-Verlag, NY. 2015.
Section : Chapter 2, Second order linear equations. Section 2.4.2 Variation of parameters. Exercises page 124
Problem number : 1(c)
Date solved : Wednesday, March 05, 2025 at 09:17:00 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{\prime \prime }-x&=\frac {1}{t} \end{align*}

Maple. Time used: 0.005 (sec). Leaf size: 32
ode:=diff(diff(x(t),t),t)-x(t) = 1/t; 
dsolve(ode,x(t), singsol=all);
 
\[ x \left (t \right ) = \frac {\operatorname {Ei}_{1}\left (-t \right ) {\mathrm e}^{-t}}{2}+c_{2} {\mathrm e}^{-t}+\left (c_{1} -\frac {\operatorname {Ei}_{1}\left (t \right )}{2}\right ) {\mathrm e}^{t} \]
Mathematica. Time used: 0.058 (sec). Leaf size: 68
ode=D[x[t],{t,2}]-x[t]==1/t; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to e^{-t} \left (e^{2 t} \int _1^t\frac {e^{-K[1]}}{2 K[1]}dK[1]+\int _1^t-\frac {e^{K[2]}}{2 K[2]}dK[2]+c_1 e^{2 t}+c_2\right ) \]
Sympy. Time used: 0.563 (sec). Leaf size: 27
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-x(t) + Derivative(x(t), (t, 2)) - 1/t,0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \left (C_{1} - \frac {\operatorname {Ei}{\left (t \right )}}{2}\right ) e^{- t} + \left (C_{2} + \frac {\operatorname {Ei}{\left (t e^{i \pi } \right )}}{2}\right ) e^{t} \]