I am calculating the integral of two indicator functions with Mathematica. I'm having difficulty in imposing assumptions. What I have done so far:
To define an indicator function:
indicator[c_,d_][x_]:= Piecewise[{{1,c<=x <= d},{0, True}}];
Then the integral is:
Integrate[indicator[-1,1][x-y]*indicator[-n,n][y], {y,-Infinity, Infinity},Assumptions->{Element[n,Integers]}]
Now what I expected, was that it gives me the length of intersection between the two segments $[-n,n]$ and $[x-1,x+1]$, but it lists a set of cases for different values of n and x, but it is still assuming n is real, because it considers cases such as $0<n<1$. Any suggestions?
Boole[]
is built-in, no? $\endgroup$ – J. M.'s ennui♦ Nov 2 '15 at 15:10UnitBox
orHeavisidePi
, properly scaled. $\endgroup$ – David G. Stork Nov 2 '15 at 18:11