Dimensional regularization: order of integration This is a two-loop calculation in dim reg where I seem to be getting different results by integrating it in different orders. I am expanding it about $D=1$. What rule am I breaking?
$$\int \frac{d^{D} p}{(2\pi)^D}\frac{d^{D}q}{(2\pi)^D}\frac{p^2+4m^2}{(q^2+m^2)((q-p)^2+m^2)}=?$$

If we integrate $q$ first, the inner integral converges in $D=1$
$$\int \frac{d^{D}q}{(2\pi)^D}\frac{1}{(q^2+m^2)((q-p)^2+m^2)}=\frac{1}{m}\frac{1}{p^2+4m^2}$$
then integrating over $p$, by the rules of dimensional regularization we have
$$\int \frac{d^{D} p}{(2\pi)^D}\frac{1}{m}\frac{p^2+4m^2}{p^2+4m^2}=0.$$

If we integrate $p$ first we have
$$\int \frac{d^{D} p}{(2\pi)^D}\frac{p^2+4m^2}{(q-p)^2+m^2}=\int \frac{d^{D} u}{(2\pi)^D}\frac{u^2+2u\cdot q +q^2+4m^2}{u^2+m^2}=\frac{q^2+4m^2}{2m}+\int \frac{d^{D} u}{(2\pi)^D}\frac{u^2}{u^2+m^2}$$
where in the last equality we threw away the $u\cdot q$ term by symmetric integration, and split off the terms in the numerator that converge in $D=1$. The remaining term is a common integral in dim reg (though perhaps the limit $D=1$ is not)
$$\int \frac{d^{D} u}{(2\pi)^D}\frac{u^2}{u^2+m^2}=\frac{1}{(4\pi)^{D/2}}\frac{D}{2}\Gamma(-D/2)(m^2)^{D/2}= -\frac{m^2}{2m}$$
where we used $\Gamma(-1/2)=-2\sqrt{\pi}$.
Now integrating the outer integral over $q$ using the same rules discussed above,
$$\int \frac{d^{D} q}{(2\pi)^D}\frac{1}{2m}\frac{q^2+3m^2}{q^2+m^2}=\frac{1}{2}\neq 0$$
What part is invalid?
 A: I'd say, when you set
$$
\int \frac{d^{D}q}{(2\pi)^D}\frac{1}{(q^2+m^2)((q-p)^2+m^2)}=\frac{1}{m}\frac{1}{p^2+4m^2}
$$
the correct answer actually has a $+\mathcal O(d-1)$ piece. The $p$ integral has $1/(d-1)$ divergences which, when multiplied by the missing subleading piece, leaves a finite contribution.
We can do the integrals exactly in $d$. For the $q$ integral we combine denominators à la Feynman, and do the linear shift $q\to q+(1-x)p$. We get
$$
\frac{2 \pi ^{d/2}}{(2 \pi )^d \Gamma \left(\frac{d}{2}\right)}\int_0^\infty\frac{q^{d-1}}{\left(m^2-p^2 (x-1) x+q^2\right)^2}\,\mathrm dq=\frac{2^{-d-1} (2-d) \pi ^{1-\frac{d}{2}} \csc \left(\frac{\pi  d}{2}\right) }{\Gamma \left(\frac{d}{2}\right)}\left(\frac{1}{m^2-p^2 (x-1) x}\right)^{2-\frac{d}{2}}
$$
Next we evaluate the $p$ integral:
\begin{align}
-\frac{2^{-d-1} (d-2) \pi ^{1-\frac{d}{2}} \left(2 \pi ^{d/2} \csc \left(\frac{\pi  d}{2}\right)\right)}{(2 \pi )^d \Gamma \left(\frac{d}{2}\right)^2}\int_0^\infty p^{d-1} \left(4 m^2+p^2\right) \left(\frac{1}{m^2-p^2 (x-1) x}\right)^{2-\frac{d}{2}}\,\mathrm dp=\\
=-2^{-2 d-1} d \pi ^{-d} m^{2 d-2} (-((x-1) x))^{-\frac{d}{2}-1} (8 d (x-1) x+d-8 (x-1) x) \Gamma (-d)
\end{align}
Finally, we perform the $x$ integral:
\begin{align}
\frac{2^{-2 d-1} (d-2) \pi ^{1-d} m^{2 d-2} \left(\csc \left(\frac{\pi  d}{2}\right) \Gamma \left(\frac{d}{2}+1\right) \Gamma (-d)\right)}{\Gamma \left(2-\frac{d}{2}\right) \Gamma \left(\frac{d}{2}\right)^2}\int_0^1((1-x) x)^{-\frac{d}{2}-1} (-8 d (1-x) x+d+8 (1-x) x)\,\mathrm dx=\\
\color{red}{\frac{2^{1-2 d} \pi ^{2-d} m^{2 d-2} \csc ^2\left(\frac{\pi  d}{2}\right)}{\Gamma \left(\frac{d}{2}\right)^2}}
\end{align}
For $d\to 1$ you can expand this as
$$
=\frac12+\big(\log\frac{m}{\pi}+\frac12\gamma\big)(d-1)+O(d-1)^2
$$
where I haven't bothered to include the standard $\mu^\epsilon$ scale to get a dimensionally consistent series.
We correctly reproduce the leading $1/2$ result.
