represents the Heaviside theta function , equal to 0 for and 1 for .


represents the multidimensional Heaviside theta function, which is 1 only if all of the xi are positive.



open allclose all

Basic Examples  (4)

Evaluate numerically:

Plot in one dimension:

Plot in two dimensions:

Differentiate to obtain DiracDelta:

Scope  (31)

Numerical Evaluation  (4)

Evaluate numerically:

HeavisideTheta always returns an exact result:

Evaluate efficiently at high precision:

HeavisideTheta threads elementwise over lists:

Specific Values  (4)

As a distribution, HeavisideTheta does not have a specific value at 0:

Value at infinity:

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  (4)

Function domain of HeavisideTheta:

It is restricted to real inputs:

Approximate function range of HeavisideTheta:

HeavisidePi has a jump discontinuity at the point :

TraditionalForm typesetting:

Differentiation  (4)

Differentiate the univariate HeavisideTheta:

Differentiate the multivariate HeavisideTheta:

Differentiate a composition involving HeavisideTheta:

Generate HeavisideTheta from an integral:

Verify the integral via differentiation:

Integration  (6)

Indefinite integral:

Integrate over finite domains:

Integrate over infinite domains:

Integrate the multivariate HeavisideTheta:

Numerical integration:

Integrate expressions containing symbolic derivatives of HeavisideTheta:

Integral Transforms  (5)

FourierTransform of HeavisideTheta:


Find the LaplaceTransform of HeavisideTheta:

The convolution of HeavisideTheta with itself:

The convolution of TemplateBox[{{x}}, HeavisideThetaSeq] with TemplateBox[{{{x, +, {1, /, 2}}}}, DiracDeltaSeq]-TemplateBox[{{{x, -, {1, /, 2}}}}, DiracDeltaSeq] is equal to TemplateBox[{{x}}, HeavisidePiSeq]:s

Applications  (6)

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:

Plot the solution:

Fundamental solution of the KleinGordon operator:

Visualize the fundamental solution (it is nonvanishing only in the forward light cone):

A cuspcontaining peakon solution of the CamassaHolm equation:

Check the solution:

Plot the solution:

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:

Use in integrals:

Use in Fourier transforms:

Use in Laplace transforms:

Possible Issues  (10)

HeavisideTheta stays unevaluated for vanishing argument:

PiecewiseExpand does not operate on HeavisideTheta because it is a distribution and not a piecewisedefined function:

The precision of the output does not track the precision of the input:

HeavisideTheta can stay unevaluated for numeric arguments:

Machineprecision numericalization of HeavisideTheta can give wrong results:

Use arbitraryprecision 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:

Neat Examples  (1)

Form repeated convolution integrals starting with a product:

Wolfram Research (2007), HeavisideTheta, Wolfram Language function, https://reference.wolfram.com/language/ref/HeavisideTheta.html.


Wolfram Research (2007), HeavisideTheta, Wolfram Language function, https://reference.wolfram.com/language/ref/HeavisideTheta.html.


@misc{reference.wolfram_2020_heavisidetheta, author="Wolfram Research", title="{HeavisideTheta}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/HeavisideTheta.html}", note=[Accessed: 10-April-2021 ]}


@online{reference.wolfram_2020_heavisidetheta, organization={Wolfram Research}, title={HeavisideTheta}, year={2007}, url={https://reference.wolfram.com/language/ref/HeavisideTheta.html}, note=[Accessed: 10-April-2021 ]}


Wolfram Language. 2007. "HeavisideTheta." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/HeavisideTheta.html.


Wolfram Language. (2007). HeavisideTheta. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HeavisideTheta.html