57.12.2 problem 1(b)

Internal problem ID [14445]
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(b)
Date solved : Thursday, October 02, 2025 at 09:37:22 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{\prime \prime }-x&={\mathrm e}^{t} t \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 25
ode:=diff(diff(x(t),t),t)-x(t) = t*exp(t); 
dsolve(ode,x(t), singsol=all);
 
\[ x = {\mathrm e}^{-t} c_2 +\frac {{\mathrm e}^{t} \left (t^{2}+4 c_1 -t \right )}{4} \]
Mathematica. Time used: 0.024 (sec). Leaf size: 35
ode=D[x[t],{t,2}]-x[t]==t*Exp[t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to \frac {1}{8} e^t \left (2 t^2-2 t+1+8 c_1\right )+c_2 e^{-t} \end{align*}
Sympy. Time used: 0.065 (sec). Leaf size: 20
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-t*exp(t) - x(t) + Derivative(x(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = C_{2} e^{- t} + \left (C_{1} + \frac {t^{2}}{4} - \frac {t}{4}\right ) e^{t} \]