The formula for a single impulse of amplitude $1$ at $x=r$ is given by

$$\frac {\sin (\pi (x-r))}{\pi (x-r)}$$

(In MathJax because it's a math formula.)

Formally, at $x=r$, this function evaluates to $\frac {0}{0}$. As a result, understandably, Mathematica returns "Indeterminate". But analytically, the function should evaluate to $1$, as this is the limit of the function as $x$ approaches $r$ from either direction.

Is there a way to persuade Mathematica to evaluate the function to $1$ at this point?

(I'm only just learning Mathematica, so please be gentle!)

  • 2
    $\begingroup$ "In MathJax because it's a math formula": please also provide Mathematica code, because this is a Mathematica forum. $\endgroup$ – MarcoB Jul 6 '18 at 15:10

Use Sinc[Pi(x-r)]. Sinc[z] is defined as Sin[z]/z unlessz==0, in which case it is 1.


By defining the following function:

f[x_] := Piecewise[{{Sin[Pi (x - r)]/(Pi (x - r)), x != r}, {1, x == r}}]

the problem is solved, in fact f[r] = 1.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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