# Remove singularity at zero from $-((i^{-n} (-1 + i^n)^2)/(n^2 π^2))$

The expression

h[n_] = -((I^-n (-1 + I^n)^2)/(n^2 π^2))


is real for all integers n. Although indeterminate at n = 0, Mathematica computes the limit to be 1/4 as n -> 0.

I'd like to use the expression in DiscreteConvolve, but even when I first declare h[0] = 1/4, a computation like

y[0] = DiscreteConvolve[h, DiscreteDelta[n], n, m]


yields only h and its explicit infinite summation representation results in "Indeterminate".

How do I make operations with h usable?

-
I do not understand your code. You write h[n_] then use it as just h with no arguments. ? DiscreteConvolve[h,DiscreteDelta[n],n,m] try it with h[n], also do not understand why you use = and not := in the definition. – Nasser May 31 '14 at 17:15

I think you are trying to do the following:

Clear[h];
h[n_] /; n >= 1 := -((I^-n (-1 + I^n)^2)/(n^2 Pi^2))

h[0] = 1/4;

Clear[y];
y[m_] := DiscreteConvolve[h[n], DiscreteDelta[n], n, m]

y[0]

(* ==> 1/4 *)


Here corrected your definition of y so it uses m as the function argument, but the important part is to understand why even with this correction your code didn't work:

The definition of h[n_] would be superseded by the specific definition h[0] if you directly asked for h[0]. However, when passed to DiscreteConvolve as an argument in the form h[n], this specific case is not used and instead h[n] is expanded to the generic expression (which is indeterminate at n=0). The remaining calculation then never knows that the expression came from h in the first place. This happens because DiscreteConvolve doesn't hold its arguments unevaluated by default.

So you have to make sure this initial expansion of h[n] doesn't occur. I do this above by adding a condition ;n>=1 to the left-hand side of the line defining h[n_]. This makes it clear that this definition is not to be used for all n. Then the generic term h[n] remains un-expanded when it is passed to DiscreteConvolve, giving it a chance to see that there is a different definition for h[0].

-