Skip to main content
added 104 characters in body
Source Link
David G. Stork
  • 43k
  • 3
  • 40
  • 110
myHeaviside[x_] := Which[x < 0, 0, x == 0, 1/2, x > 0, 1] 

Note that the derivative, computed as a limit, is properly a representation of a DiracDelta function (though its integral and higher derivatives might not be appropriately represented):

Limit[(myHeaviside[x + ε] - myHeaviside[x])/ε, ε -> 0] 

$\begin{cases} \infty & x=0 \\ 0 & \text{True} \end{cases}$

myHeaviside[x_] := Which[x < 0, 0, x == 0, 1/2, x > 0, 1] 

Note that the derivative, computed as a limit, is properly a DiracDelta function:

Limit[(myHeaviside[x + ε] - myHeaviside[x])/ε, ε -> 0] 

$\begin{cases} \infty & x=0 \\ 0 & \text{True} \end{cases}$

myHeaviside[x_] := Which[x < 0, 0, x == 0, 1/2, x > 0, 1] 

Note that the derivative, computed as a limit, is properly a representation of a DiracDelta function (though its integral and higher derivatives might not be appropriately represented):

Limit[(myHeaviside[x + ε] - myHeaviside[x])/ε, ε -> 0] 

$\begin{cases} \infty & x=0 \\ 0 & \text{True} \end{cases}$

deleted 15 characters in body
Source Link
David G. Stork
  • 43k
  • 3
  • 40
  • 110
myHeaviside[x_] := Which[x < 0, 0, x == 0, 1/2, x > 0, 1] 

Note that the derivative, computed as a limit, is properly calculateda DiracDelta function:

D[myHeaviside[x]Limit[(myHeaviside[x + ε] - myHeaviside[x])/ε, x]ε -> 0] 

(*

Which[x < 0, 0, x == 0, 0, x > 0, 0]

*)

and Simplify[%]

(*

0

*)$\begin{cases} \infty & x=0 \\ 0 & \text{True} \end{cases}$

myHeaviside[x_] := Which[x < 0, 0, x == 0, 1/2, x > 0, 1] 

Note that the derivative is properly calculated:

D[myHeaviside[x], x] 

(*

Which[x < 0, 0, x == 0, 0, x > 0, 0]

*)

and Simplify[%]

(*

0

*)

myHeaviside[x_] := Which[x < 0, 0, x == 0, 1/2, x > 0, 1] 

Note that the derivative, computed as a limit, is properly a DiracDelta function:

Limit[(myHeaviside[x + ε] - myHeaviside[x])/ε, ε -> 0] 

$\begin{cases} \infty & x=0 \\ 0 & \text{True} \end{cases}$

Source Link
David G. Stork
  • 43k
  • 3
  • 40
  • 110

myHeaviside[x_] := Which[x < 0, 0, x == 0, 1/2, x > 0, 1] 

Note that the derivative is properly calculated:

D[myHeaviside[x], x] 

(*

Which[x < 0, 0, x == 0, 0, x > 0, 0]

*)

and Simplify[%]

(*

0

*)