57.9.13 problem 2(a)

Internal problem ID [14421]
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.3.1 Nonhomogeneous Equations: Undetermined Coefficients. Exercises page 110
Problem number : 2(a)
Date solved : Thursday, October 02, 2025 at 09:36:59 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{\prime \prime }+7 x&=t \,{\mathrm e}^{3 t} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 32
ode:=diff(diff(x(t),t),t)+7*x(t) = t*exp(3*t); 
dsolve(ode,x(t), singsol=all);
 
\[ x = \sin \left (\sqrt {7}\, t \right ) c_2 +\cos \left (\sqrt {7}\, t \right ) c_1 +\frac {\left (8 t -3\right ) {\mathrm e}^{3 t}}{128} \]
Mathematica. Time used: 0.014 (sec). Leaf size: 42
ode=D[x[t],{t,2}]+7*x[t]==t*Exp[3*t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to \frac {1}{128} e^{3 t} (8 t-3)+c_1 \cos \left (\sqrt {7} t\right )+c_2 \sin \left (\sqrt {7} t\right ) \end{align*}
Sympy. Time used: 0.063 (sec). Leaf size: 39
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-t*exp(3*t) + 7*x(t) + Derivative(x(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = C_{1} \sin {\left (\sqrt {7} t \right )} + C_{2} \cos {\left (\sqrt {7} t \right )} + \frac {t e^{3 t}}{16} - \frac {3 e^{3 t}}{128} \]