HeavisideTheta
represents the Heaviside theta function , equal to 0 for
and 1 for
.
HeavisideTheta[x1,x2,…]
represents the multidimensional Heaviside theta function, which is 1 only if all of the xi are positive.
Details

- HeavisideTheta[x] returns 0 or 1 for all real numeric x other than 0.
- HeavisideTheta can be used in integrals, integral transforms, and differential equations.
- HeavisideTheta has attribute Orderless.
- For exact numeric quantities, HeavisideTheta internally uses numerical approximations to establish its result. This process can be affected by the setting of the global variable $MaxExtraPrecision.
Examples
open allclose allBasic Examples (4)
Differentiate to obtain DiracDelta:
Scope (37)
Numerical Evaluation (5)
HeavisideTheta always returns an exact result:
Evaluate efficiently at high precision:
Compute average-case statistical intervals using Around:
Compute the elementwise values of an array:
Or compute the matrix HeavisideTheta function using MatrixFunction:
Specific Values (4)
As a distribution, HeavisideTheta does not have a specific value at 0:
Evaluate for symbolic parameters:
Find a value of x for which the HeavisideTheta[x]=1:
Visualization (4)
Plot the HeavisideTheta function:
Visualize shifted HeavisideTheta functions:
Visualize the composition of HeavisideTheta with a periodic function:
Plot HeavisideTheta in three dimensions:
Function Properties (9)
Function domain of HeavisideTheta:
It is restricted to real inputs:
Function range of HeavisideTheta:
HeavisideTheta has a jump discontinuity at the point :
HeavisideTheta is not an analytic function:
It has both singularities and discontinuities:
HeavisideTheta is not injective:
HeavisideTheta is not surjective:
HeavisideTheta is non-negative on its domain:
HeavisideTheta is neither convex nor concave:
TraditionalForm typesetting:
Differentiation (4)
Differentiate the univariate HeavisideTheta:
Differentiate the multivariate HeavisideTheta:
Differentiate a composition involving HeavisideTheta:
Generate HeavisideTheta from an integral:
Integration (6)
Integrate over finite domains:
Integrate over infinite domains:
Integrate the multivariate HeavisideTheta:
Integrate expressions containing symbolic derivatives of HeavisideTheta:
Integral Transforms (5)
FourierTransform of HeavisideTheta:
Find the LaplaceTransform of HeavisideTheta:
The convolution of HeavisideTheta with itself:
Applications (7)
Solve the time‐independent Schrödinger equation with piecewise analytic potential:
Use DSolve with DiracDelta source term to find Green's function:
Solve the inhomogeneous ODE through convolution with Green's function:
Compare with the direct result from DSolve:
Model a uniform probability distribution:
Calculate the probability distribution for the sum of two uniformly distributed variables:
Plot the distributions for the sum:
Fundamental solution (Green's function) of the 1D wave equation:
Solution for a given source term:
Fundamental solution of the Klein–Gordon operator:
Visualize the fundamental solution (it is nonvanishing only in the forward light cone):
A cusp‐containing peakon solution of the Camassa–Holm equation:
Differentiate and integrate a piecewise-defined function in a lossless manner:
Differentiating and integrating recovers the original function:
Using Piecewise does not recover the original function:
Properties & Relations (6)
The derivative of HeavisideTheta is a distribution:
The derivative of UnitStep is a piecewise function:
Expand HeavisideTheta into HeavisideTheta with simpler arguments:
Simplify expressions containing HeavisideTheta:
Possible Issues (10)
HeavisideTheta stays unevaluated for vanishing argument:
PiecewiseExpand does not operate on HeavisideTheta because it is a distribution and not a piecewise‐defined function:
The precision of the output does not track the precision of the input:
HeavisideTheta can stay unevaluated for numeric arguments:
Machine‐precision numericalization of HeavisideTheta can give wrong results:
Use arbitrary‐precision arithmetic to obtain the correct result:

A larger setting for $MaxExtraPrecision will not avoid the N::meprec message because the result is exact:

The functions UnitStep and HeavisideTheta are not mathematically equivalent:
Products of distributions with coincident singular support cannot be defined (no Colombeau algebra interpretation):

HeavisideTheta cannot be uniquely defined with complex arguments (no Sato hyperfunction interpretation):
Numerical routines can have problems with discontinuous functions:



Limit does not give HeavisideTheta as a limit of smooth functions:
Text
Wolfram Research (2007), HeavisideTheta, Wolfram Language function, https://reference.wolfram.com/language/ref/HeavisideTheta.html.
CMS
Wolfram Language. 2007. "HeavisideTheta." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/HeavisideTheta.html.
APA
Wolfram Language. (2007). HeavisideTheta. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HeavisideTheta.html