## WolframAlpha – answering the unanswerable

I had a funny experience with WolframAlpha recently. I typed in:

differentiate (t-t^2/2)Heaviside(t) at t=0

and the result was (as you can probably see in the link):

$\theta(0)\approx\theta(0.)$, alternate form $1$

Surprise, surprise. The function obviously doesn’t have a derivative in that point, but WolframAlpha bravely calculates it. I tested Mathematica 7 with the same question, using both UnitStep and HeavisideTheta for the unit step function. The difference between these two is that HeavisideTheta implemented in Mathematica is undefined at 0, while the UnitStep’s value at 0 is 1.

Heaviside theta case:

In[1]:= D[HeavisideTheta[t] (t – t^2/2), t]

Out[1]:= (t – t^2/2) DiracDelta[t] + (1 – t) HeavisideTheta[t]

In[2]:= % /. t -> 0

Out[2]:= HeavisideTheta[0]

As noted, HeavisideTheta[0] has no defined value.

Unit step case:

In[1]:= D[UnitStep[t] (t – t^2/2), t]

Out[1]:=(t – t^2/2) (\[Piecewise] {{Indeterminate, t == 0},{0, \!\(\*TagBox[“True”,”PiecewiseDefault”,AutoDelete->False, DeletionWarning->True]\)} }) + (1 – t) UnitStep[t]

In[2]:= %/.t->0

Out[2]:=Indeterminate

This opens few other questions about these calculations, but I’ll stop right here.