I was studying Statistical Physics from the book : Fundamentals of Statistical and Thermal Physics by Reif, in it is a section where the probability distribution of the displacement of 1D random walk problem for a given probability distribution of the step length for each step is given, is calculated. It goes as follows:
w(s) : Probability distribution of the step length s in random walk, i.e. the probability of a step being of length between s and s+ds = w(s)ds (s can be negative too)
N : Total number of steps
P(x) : Probability distribution of the total displacement after N steps
$P(x)dx = \idotsint_{-\infty}^{\infty}\prod w_i(s_i)ds_i$ with the constraint that $x<\sum_{i=1}^N s_i < x+dx$
Next they take care of the constraints by including a dirac delta function into the integrand
$P(x)dx = \int_{-\infty}^{\infty}(\idotsint_{-\infty}^{\infty}\prod w_i(s_i)ds_i)\delta(x-\sum_{i=1}^N s_i )dx$
So far nothing much impressive is done but in the next step they use the inverse fourier integral formula for $\delta$ function, an out of the box move,
$\delta(x-\sum_{i=1}^N s_i) = \frac{1}{2\pi}\int_{-\infty}^{\infty}e^{ik(\sum s_i - x)}dk$
which gives us:
$P(x) = \frac{1}{2\pi}(\int_{-\infty}^{\infty}e^{-ikx}dk).(\prod_{i=1}^N\int_{-\infty}^{\infty}w(s_i)e^{iks_i}ds_i)$
Which solves the problem. I have two questions regarding this method
Q1: How can one even think of introducing dirac delta function and then using the inverse fourier integral formula for it? Is this some kind of approach commonly used in calculating other integrals as well?
Q2: Is there any general way of integrating a multivariable function having constraints in the variables? In the above example the constraint was that the sum of the variables is between x and x+dx, but what about any general constraint $g(s_1, ...,s_N)=0$ then is there any general way of finding the integral of a function $f(s_1, ...,s_N)$ over some range