71.16.1 problem 1

Internal problem ID [14479]
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 : 1
Date solved : Monday, March 31, 2025 at 12:28:13 PM
CAS classification : [[_linear, `class A`]]

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

Using Laplace method With initial conditions

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

Maple. Time used: 0.110 (sec). Leaf size: 18
ode:=diff(y(x),x)+3*y(x) = Dirac(x-2); 
ic:=y(0) = 1; 
dsolve([ode,ic],y(x),method='laplace');
 
\[ y = {\mathrm e}^{-3 x} \left ({\mathrm e}^{6} \operatorname {Heaviside}\left (x -2\right )+1\right ) \]
Mathematica. Time used: 0.034 (sec). Leaf size: 29
ode=D[y[x],x]+3*y[x]==DiracDelta[x-2]; 
ic={y[0]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-3 x} \left (\int _0^xe^6 \delta (K[1]-2)dK[1]+1\right ) \]
Sympy. Time used: 0.711 (sec). Leaf size: 46
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-Dirac(x - 2) + 3*y(x) + Derivative(y(x), x),0) 
ics = {y(0): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ - \int \operatorname {Dirac}{\left (x - 2 \right )} e^{3 x}\, dx + 3 \int y{\left (x \right )} e^{3 x}\, dx = - \int \limits ^{0} \operatorname {Dirac}{\left (x - 2 \right )} e^{3 x}\, dx + 3 \int \limits ^{0} y{\left (x \right )} e^{3 x}\, dx \]