63.17.5 problem 7

Internal problem ID [13125]
Book : A First Course in Differential Equations by J. David Logan. Third Edition. Springer-Verlag, NY. 2015.
Section : Chapter 3, Laplace transform. Section 3.4 Impulsive sources. Exercises page 173
Problem number : 7
Date solved : Wednesday, March 05, 2025 at 09:17:51 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{\prime \prime }+x&=3 \delta \left (t -2 \pi \right ) \end{align*}

Using Laplace method With initial conditions

\begin{align*} x \left (0\right )&=0\\ x^{\prime }\left (0\right )&=1 \end{align*}

Maple. Time used: 8.591 (sec). Leaf size: 17
ode:=diff(diff(x(t),t),t)+x(t) = 3*Dirac(t-2*Pi); 
ic:=x(0) = 0, D(x)(0) = 1; 
dsolve([ode,ic],x(t),method='laplace');
 
\[ x \left (t \right ) = \sin \left (t \right ) \left (3 \operatorname {Heaviside}\left (t -2 \pi \right )+1\right ) \]
Mathematica. Time used: 0.021 (sec). Leaf size: 47
ode=D[x[t],{t,2}]+x[t]==3*DiracDelta[t-2*Pi]; 
ic={x[0]==0,Derivative[1][x][0 ]==1}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \sin (t) \left (-\int _1^03 \delta (K[1]-2 \pi )dK[1]\right )+\sin (t) \int _1^t3 \delta (K[1]-2 \pi )dK[1]+\sin (t) \]
Sympy. Time used: 0.769 (sec). Leaf size: 65
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-3*Dirac(t - 2*pi) + x(t) + Derivative(x(t), (t, 2)),0) 
ics = {x(0): 0, Subs(Derivative(x(t), t), t, 0): 1} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \left (- 3 \int \operatorname {Dirac}{\left (t - 2 \pi \right )} \sin {\left (t \right )}\, dt + 3 \int \limits ^{0} \operatorname {Dirac}{\left (t - 2 \pi \right )} \sin {\left (t \right )}\, dt\right ) \cos {\left (t \right )} + \left (3 \int \operatorname {Dirac}{\left (t - 2 \pi \right )} \cos {\left (t \right )}\, dt - 3 \int \limits ^{0} \operatorname {Dirac}{\left (t - 2 \pi \right )} \cos {\left (t \right )}\, dt + 1\right ) \sin {\left (t \right )} \]