80.10.13 problem 40

Internal problem ID [21408]
Book : A Textbook on Ordinary Differential Equations by Shair Ahmad and Antonio Ambrosetti. Second edition. ISBN 978-3-319-16407-6. Springer 2015
Section : Chapter 11. Laplace transform. Excercise 11.7 at page 248
Problem number : 40
Date solved : Thursday, October 02, 2025 at 07:30:53 PM
CAS classification : system_of_ODEs

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

With initial conditions

\begin{align*} x \left (0\right )&=0 \\ y \left (0\right )&=0 \\ \end{align*}
Maple. Time used: 1.771 (sec). Leaf size: 50
ode:=[diff(x(t),t) = x(t)+y(t), diff(y(t),t) = -y(t)+Dirac(t)]; 
ic:=[x(0) = 0, y(0) = 0]; 
dsolve([ode,op(ic)]);
 
\begin{align*} x \left (t \right ) &= {\mathrm e}^{t} \left (\frac {\left (\left \{\begin {array}{cc} \frac {{\mathrm e}^{-2 t}}{2} & t \le 0 \\ -\frac {{\mathrm e}^{-2 t}}{2}+1 & 0<t \end {array}\right .\right )}{2}-\frac {1}{4}\right ) \\ y \left (t \right ) &= \left (\operatorname {Heaviside}\left (t \right )+\left (\left \{\begin {array}{cc} -\frac {1}{2} & t =0 \\ 0 & \operatorname {otherwise} \end {array}\right .\right )-\frac {1}{2}\right ) {\mathrm e}^{-t} \\ \end{align*}
Mathematica. Time used: 0.004 (sec). Leaf size: 44
ode={D[x[t],t]==x[t]+y[t],D[y[t],t]==-y[t]+DiracDelta[t]}; 
ic={x[0] ==0,y[0]==0}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to -\frac {1}{2} e^{-t} \left (e^{2 t}-1\right ) (\theta (0)-\theta (t))\\ y(t)&\to e^{-t} (\theta (t)-\theta (0)) \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode=[Eq(-x(t) - y(t) + Derivative(x(t), t),0),Eq(-Dirac(t) + y(t) + Derivative(y(t), t),0)] 
ics = {x(0): 0, y(0): 0} 
dsolve(ode,func=x(t),ics=ics)
 
ValueError : 
Input to the funcs should be a list of functions.