(simple) question about interchanging limits, integrals and sums I'm having troubles figuring out the following problem.

we wanna show that $$\sum_{n=0}^\infty\int_D f_d^n \, \mathrm d x \begin{cases} = \infty, \quad & d=1,2 \\ < \infty, \quad & d \geq 3\end{cases}$$ where $f_d (x) = \frac 1 d \sum_{i=1}^d \cos(2 \, \pi \, x_i)$ and $D = [-\frac 1 2 ,\frac 1 2]^d$.

So the idea is to do this 
\begin{align}
\sum_{n=0}^\infty\int_D f_d^n \, \mathrm d x 
& \overset{(1)} = \sum_{n=0}^\infty \int_D  \lim_{\varepsilon \uparrow 1} \, (\varepsilon \,f_d)^n \, \mathrm d x 
\overset{(2)} = \sum_{n=0}^\infty \lim_{\varepsilon \uparrow 1} \int_D (\varepsilon \,f_d)^n \, \mathrm d x \\
& \overset{(3)} =  \lim_{\varepsilon \uparrow 1} \sum_{n=0}^\infty \int_D (\varepsilon \,f_d)^n \, \mathrm d x
\overset{(4)} =  \lim_{\varepsilon \uparrow 1} \int_D \sum_{n=0}^\infty (\varepsilon \,f_d)^n \, \mathrm d x \\
& \overset{(5)} = \lim_{\varepsilon \uparrow 1} \int_D \frac 1 {1 - \varepsilon \,f_d} \, \mathrm d x
\overset{(6)} = \int_D \frac 1 {1 - f_d} \, \mathrm d x
\end{align}
and then the last integral can be bounded from above (for $d \geq 3$) and below (for $d = 1,2$) by the inequality $$\frac {y^2} 6 \leq 1 - \cos(y) \leq \frac {y^2} 2, \quad y \in [-\pi , \pi]$$
That said, we have $$\int_D \frac 1 {1 - f_d} \, \mathrm d x \begin{cases} = \infty, \quad & d=1,2 \\ < \infty, \quad & d \geq 3 .\end{cases}$$

Now my question is, how do I justify the interchanging of limits above? 
In particular in the case $d = 1,2$ in (3) and (6).
$\,$
(1) is easy, nothing happens
(2) is understood by the dominant convergence theorem by Lebesgue, since $|f_d| \leq 1$ is bounded
(4) & (5) also easy, since for $0 < \varepsilon < 1$ we have $\int_D (\varepsilon \, f_d)^n \, \mathrm d x < 1$ and therefore the geometric sum converges, and power series can be integrated term by term within their radius of convergence
$\,$
However, I can only justify (6) if $d \geq 3$, otherwise the last integral is unbounded.
For (3) I tried to show that $$h_d(\varepsilon) : = \sum_{n=0}^\infty \int_D (\varepsilon \,f_d)^n \, \mathrm d x = \int_D \frac 1 {1 - \varepsilon \, f_d} \, \mathrm d x$$ is continuous at $\varepsilon = 1$, that is $|h_d(\varepsilon) - h_d(1)| \to 0 \, \,(\varepsilon \to 1)$ for any $d$, but I didn't manage.
$\,$
Is there any easier way to do that?
Any help much appreciated!
 A: My claim is that for $d = 1,2$ the function $h_d(\varepsilon)$ is actually discontinuous at $\varepsilon = 1$.
$$|h_d(1) - h_d(\varepsilon)| = \bigg| \int_D \frac {(1-\varepsilon) \, f_d} {(1 - \varepsilon \, f_d) \, (1 - f_d)} \, \mathrm d x \bigg| \geq \bigg| \int_D \frac{(1-\varepsilon) \, f_d} {4 \, \pi \, x^2} \, \mathrm d x \bigg|,$$
since $ 1 - \cos(y) \leq \frac {y^2} 2$ and $1 - \varepsilon \, f_d \leq 2$.
Now estimate with $$f_d \geq \begin{cases} \frac 1 2, \quad & |x| \leq \frac 1 {12}, \\ - 1, \quad & |x| \geq \frac 1 {12}, \, x \in D \end{cases}$$
and the abbreviations $A = \{x \in D \, : \, |x| \leq \frac 1 {12}\}$, $\, B = D \smallsetminus A$
$$\int_A \frac {\mathrm d x} {8 \, \pi \, x^2} \underbrace{- \int_B \frac {\mathrm d x} {4 \, \pi \, x^2}}_{|\cdot | < \infty} \leq \int_D \frac {f_d} {4 \, \pi \, x^2} \, \mathrm d x.$$
However, for $d = 1,2$ the first term is unbounded and positive. Observe now that $$a_\varepsilon := |h_d(1) - h_d(\varepsilon)| > \delta$$ for any $\delta > 0$ for any $\varepsilon < 1$ and thus $$\lim_{\varepsilon \to 1} a_\varepsilon = \infty.$$

For $d \geq 3$ there is no problem with (6) and even (3), since $\frac 1 {1 - f_d}$ is a summable upper bound, and $h_d(\varepsilon)$ is continuous at $\varepsilon = 1$.
\begin{align}
|h_d(1) - h_d(\varepsilon)| 
& \leq \int_D \frac {|1-\varepsilon| \, f_d} {|1 - \varepsilon \, f_d| \, |1 - f_d|} \, \mathrm d x \\
& \leq \int_D \frac {|1-\varepsilon| \, f_d} {|\varepsilon \, \frac {4 \, \pi \, x^2} 6 + 1 - \varepsilon| \, \frac {4 \, \pi \, x^2} 6} \, \mathrm d x \leq C \, (1-\varepsilon) \to 0 \;\;\; (\varepsilon \to 1)
\end{align}

So what's left: Show that for $d= 1,2$ $$\sum_{n=0}^\infty \int_D f^n_d \, \mathrm d x = \infty.$$
How do I do that?
