I'm trying to show that the Kernel density estimate
$$ f(x) = \frac1{nb}\sum_{i=1}^nK \left(\frac {X_i - x}b\right) $$
actually integrates to 1. The $X_i$ are iid and K is a symmetric probability density function; in particular, K integrates to 1. What I get is
$$\int_{-\infty}^{\infty} \frac1{nb}\sum_{i=1}^nK\left(\frac {X_i - x}b\right) dx$$ $$ = \frac1{nb}\int_{-\infty}^{\infty} \sum_{i=1}^nK\left(\frac {X_i - x}b\right) dx $$
$$=\frac1{nb}\sum_{i=1}^n\int_{-\infty}^{\infty} K\left(\frac {X_i - x}b\right) dx$$ $$=\frac1{b}\int_{-\infty}^{\infty} K\left(\frac {X_i - x}b\right) dx$$
Using as a substitution
$$ u = \frac {X_i - x}b$$ $$ dx = -b du$$
we get
$$=\frac1{b}\int_{-\infty}^{\infty} K(u) (-b) du $$ $$= (-b) \frac1{b}\int_{-\infty}^{\infty} K(u) du = -1$$
Something must have gone wrong with the integration. I know that $f(x)$ is often defined differently, as
$$ f'(x) = \frac1{nb}\sum_{i=1}^nK\left(\frac {x - X_i}b\right) $$
and with this version I can show that it integrates to 1. However $f'(x)$ and $f(x)$ should be equivalent as $K$ is symmetric. So there is some flaw in my calculations (my knowledge about integration with substitution is purely heuristic).
$\require{cancel}$ \begin{align} \int_{-\infty}^{+\infty} f(x)~{\rm d}x &= \frac{1}{nb}\sum_{i = 1}^n \int_{-\infty}^{+\infty} K\left(\frac{X_i - x}{b}\right){\rm d}x & \text{with } ~u = \frac{X_i - x}{b},~{\rm d}u = -{\rm d}x/b \\ &= -\frac{1}{n}\sum_{i=1}^n \int_{+\infty}^{-\infty} K(u)~{\rm du} \\ &= \frac{1}{n}\sum_{i=1}^n \cancelto{1}{\int_{-\infty}^{+\infty}K(u){\rm d}u} \\ &= \frac{1}{\cancel{n}} \cancel{n} = 1 \end{align}
The part you need to pay attention to is the limits, when $x\to +\infty$ you have $u \to -\infty$ and vice versa. So the limits of the integral change of order