# 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 • 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 all

## Basic Examples(4)

Evaluate numerically:

Plot in one dimension:

Plot in two dimensions:

Differentiate to obtain DiracDelta:

## Scope(36)

### 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(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:

### 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)

Find the LaplaceTransform of HeavisideTheta:

The convolution of HeavisideTheta with itself:

The convolution of with is equal to :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: