71.16.3 problem 3

Internal problem ID [14481]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 5. The Laplace Transform Method. Exercises 5.5, page 273
Problem number : 3
Date solved : Monday, March 31, 2025 at 12:28:16 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Using Laplace method With initial conditions

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

Maple. Time used: 0.280 (sec). Leaf size: 23
ode:=diff(diff(y(x),x),x)+9*y(x) = Dirac(x-Pi)+Dirac(x-3*Pi); 
ic:=y(0) = 0, D(y)(0) = 0; 
dsolve([ode,ic],y(x),method='laplace');
 
\[ y = -\frac {\left (\operatorname {Heaviside}\left (x -3 \pi \right )+\operatorname {Heaviside}\left (x -\pi \right )\right ) \sin \left (3 x \right )}{3} \]
Mathematica. Time used: 0.06 (sec). Leaf size: 79
ode=D[y[x],{x,2}]+9*y[x]==DiracDelta[x-Pi]+DiracDelta[x-3*Pi]; 
ic={y[0]==0,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \sin (3 x) \int _1^x\frac {1}{3} \cos (3 K[1]) (\delta (K[1]-3 \pi )+\delta (K[1]-\pi ))dK[1]-\sin (3 x) \int _1^0\frac {1}{3} \cos (3 K[1]) (\delta (K[1]-3 \pi )+\delta (K[1]-\pi ))dK[1] \]
Sympy. Time used: 1.653 (sec). Leaf size: 110
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-Dirac(x - 3*pi) - Dirac(x - pi) + 9*y(x) + Derivative(y(x), (x, 2)),0) 
ics = {y(0): 0, Subs(Derivative(y(x), x), x, 0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (- \frac {\int \left (\operatorname {Dirac}{\left (x - 3 \pi \right )} + \operatorname {Dirac}{\left (x - \pi \right )}\right ) \sin {\left (3 x \right )}\, dx}{3} + \frac {\int \limits ^{0} \operatorname {Dirac}{\left (x - 3 \pi \right )} \sin {\left (3 x \right )}\, dx}{3} + \frac {\int \limits ^{0} \operatorname {Dirac}{\left (x - \pi \right )} \sin {\left (3 x \right )}\, dx}{3}\right ) \cos {\left (3 x \right )} + \left (\frac {\int \left (\operatorname {Dirac}{\left (x - 3 \pi \right )} + \operatorname {Dirac}{\left (x - \pi \right )}\right ) \cos {\left (3 x \right )}\, dx}{3} - \frac {\int \limits ^{0} \operatorname {Dirac}{\left (x - 3 \pi \right )} \cos {\left (3 x \right )}\, dx}{3} - \frac {\int \limits ^{0} \operatorname {Dirac}{\left (x - \pi \right )} \cos {\left (3 x \right )}\, dx}{3}\right ) \sin {\left (3 x \right )} \]