2
$\begingroup$

The Heaviside step function implicitly expands to a piecewise function:

UnitStep[t - 3] // PiecewiseExpand

$$ \begin{cases} 1 & t\geq 3 \\ 0 & \text{True} \\ \end{cases} $$

But the Heaviside step with strict inequalities does not have an implicit expansion:

HeavisideTheta[t - 3] // PiecewiseExpand

$$ \theta (t-3) $$

and the expansion must be given explicitly (Solution from this answer):

% /. {
   HeavisideTheta[x_] :> Piecewise[{{1, x > 0}, {0, x < 0}}]
} // PiecewiseExpand

$$ \begin{cases} 1 & t>3 \\ 0 & \text{True} \\ \end{cases} $$

Is this just an oversight in the implementation or is there a more nuanced distinction?

Related:

Converting HeavisideTheta[]s and Sign[]s functions to a single Piecewise[]

UnitStep vs HeavisideTheta; KroneckerDelta vs DiscreteDelta

$\endgroup$
2
  • 5
    $\begingroup$ D[HeavisideTheta[x], x] evaluates to DiracDelta[x]. If HeavisideTheta converted to a Piecewise expression this relation to DiracDelta would be obscured. $\endgroup$
    – Bob Hanlon
    May 3, 2020 at 21:55
  • 2
    $\begingroup$ @Bob I saw that you converted your answer into a comment. I think it’s insightful enough to stand as an answer though. Would you consider undeleting? $\endgroup$
    – MarcoB
    May 5, 2020 at 3:48

1 Answer 1

3
$\begingroup$

D[HeavisideTheta[x], x] evaluates to DiracDelta[x]. If HeavisideTheta converted to a Piecewise expression this relation to DiracDelta would be obscured.

$\endgroup$
1
  • 1
    $\begingroup$ Thank you! (+1) $\endgroup$
    – MarcoB
    May 5, 2020 at 3:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.