%% Differentiate and Integrate Expressions Involving Heaviside Function
% Compute derivatives and integrals of expressions involving the Heaviside function.
% Find the first derivative of the Heaviside function. The first derivative of the Heaviside function is the Dirac delta function.

syms x
diff_H = diff(heaviside(x),x)

% Evaluate the integral \int_{-\infty }^{\infty } e^{-x} H\left(x\right)\;\textrm{dx}.

syms x
int_H = int(exp(-x)*heaviside(x),x,-Inf,Inf)

%
% Copyright 2006-2019 The MathWorks, Inc.