Skip to content

HeavisideTheta ​

The Heaviside step function: 0 for x < 0, 1 for x > 0, unevaluated at x = 0.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageHeavisideTheta!
HeavisideTheta(x)0 if x < 0, 1 if x > 0, and unevaluated (stays symbolic) at x = 0.
HeavisideTheta(x1, x2, …)the product of the individual steps -- 0 as soon as any argument is negative, unevaluated if none is negative but at least one is exactly 0.
Typed signatures
TypePackageApplies
(real, real*) -> numberanalyticalways

Domain: Elementary functions

Details
  • Deliberately distinct from compute-engine's own native Heaviside, which this package does not touch: Heaviside(0) evaluates to 0 there, not Wolfram's convention. HeavisideTheta is a separate head so both conventions stay available.
  • Also distinct from UnitStep (declared in unit-step.ts), which takes the value 1 at exactly 0 rather than staying unevaluated.
  • D(HeavisideTheta(x), x) = DiracDelta(x).

Examples

Basic #
live ↗
InHeavisideTheta(−1)\mathrm{HeavisideTheta}(-1)Out00
live ↗
InHeavisideTheta(1)\mathrm{HeavisideTheta}(1)Out11

Unevaluated at exactly 0 -- unlike UnitStep

live ↗
InHeavisideTheta(0)\mathrm{HeavisideTheta}(0)OutHeavisideTheta(0)\mathrm{HeavisideTheta}(0)
Scope #

Several arguments: the product of their steps

live ↗
InHeavisideTheta(1,2)\mathrm{HeavisideTheta}(1, 2)Out11

Zero as soon as any argument is negative

live ↗
InHeavisideTheta(1,−1)\mathrm{HeavisideTheta}(1, -1)Out00

A matrix function of the step in terms of its eigenvalues

live ↗
InMatrixFunction(HeavisideTheta,[[−1,−12],[−12,12]])\mathrm{MatrixFunction}(\mathrm{HeavisideTheta}, \bigl\lbrack\bigl\lbrack-1, -\frac{1}{2}\bigr\rbrack, \bigl\lbrack-\frac{1}{2}, \frac{1}{2}\bigr\rbrack\bigr\rbrack)Out[[126(13(131/2−3)),−131/213],[−131/213,126(13(3+13))]]\bigl\lbrack\bigl\lbrack\frac{1}{26}(\sqrt{13}(13^{1/2}-3)), -\frac{13^{1/2}}{13}\bigr\rbrack, \bigl\lbrack-\frac{13^{1/2}}{13}, \frac{1}{26}(\sqrt{13}(3+\sqrt{13}))\bigr\rbrack\bigr\rbrack

With more than one argument the sign assumption does not resolve it

live ↗
InAssuming(a>0,Refine(HeavisideTheta(a,a,a,a)))\mathrm{Assuming}(a\gt0, \mathrm{Refine}(\mathrm{HeavisideTheta}(a, a, a, a)))OutHeavisideTheta(a,a,a,a)\mathrm{HeavisideTheta}(a, a, a, a)

Negative assumption leaves it symbolic

live ↗
InAssuming(a<0,Refine(HeavisideTheta(a,a,a,a)))\mathrm{Assuming}(a\lt0, \mathrm{Refine}(\mathrm{HeavisideTheta}(a, a, a, a)))OutHeavisideTheta(a,a,a,a)\mathrm{HeavisideTheta}(a, a, a, a)

Mixed-sign assumptions still leave it symbolic

live ↗
InAssuming(a<0∧b>0,Refine(HeavisideTheta(b,b,a)))\mathrm{Assuming}(a\lt0∧b\gt0, \mathrm{Refine}(\mathrm{HeavisideTheta}(b, b, a)))OutHeavisideTheta(b,b,a)\mathrm{HeavisideTheta}(b, b, a)
Properties #

Derivative is DiracDelta

live ↗
IndHeavisideTheta(x)dx\frac{\mathrm{d}\mathrm{HeavisideTheta}(x)}{\mathrm{d}x}OutDiracDelta(x)\mathrm{DiracDelta}(x)
live ↗
InHeavisideTheta(12)2\mathrm{HeavisideTheta}(\frac{1}{2})^2Out11

Known value · Wolfram MathematicalFunctionData, HeavisideTheta, FunctionalEquations

live ↗
InHeavisideTheta(2)HeavisideTheta(12)\mathrm{HeavisideTheta}(2)\mathrm{HeavisideTheta}(\frac{1}{2})Out11

Known value · Wolfram MathematicalFunctionData, HeavisideTheta, FunctionalEquations

About
Examples12
Checked againstWolfram Language 9 agree3 differ
CrosswalkWolfram Language