I came across this integral involving the derivative $f'(x)$ of the Fermi function $f(x)=(1+e^x)^{-1}$:
$$I(\phi)=-\int\_{-\infty}^\infty \log\left[1+2f'(x)(1-\cos\phi)\right]\,dx.$$
I'm pretty certain that $I(\phi)=\phi^2$ for $|\phi|<\pi$, periodically repeated, as in the plot. It means that only the ${\cal O}(\phi^2)$ term in a Taylor expansion of the integrand has a nonzero contribution, but I am unable to prove this. (Mathematica returns a polylog function, and will not simplify it further.) Any help would be much appreciated, I'm hoping such a simple answer will have a simple derivation --- perhaps without needing special functions?


![](https://ilorentz.org/beenakker/MO/fermiintegralplot.png)



Why is $-\int_{-\infty}^\infty \log\left[1+2f'(x)(1-\cos\phi)\right]\,dx$ equal to $\phi^2$?
It is clear that $I(0)=0$, hence by [Leibniz's integration rule](https://en.wikipedia.org/wiki/Leibniz_integral_rule), it suffices to show that
$$\int\_{-\infty}^\infty\frac{-2f'(x)\sin\phi}{1+2f'(x)(1-\cos\phi)}\,dx=2\phi,\qquad |\phi|<\pi.$$
We can assume, without loss of generality, that $0<\phi<\pi$. By a bit of algebra, we can rewrite the last equation as
$$\int\_{-\infty}^\infty\frac{e^x\sin\phi}{e^{2x}+2(\cos\phi)e^x+1}\,dx=\phi.$$
By the change of variables $u=(e^x+\cos\phi)/\sin\phi$, this becomes
$$\int\_{\frac{\cos\phi}{\sin\phi}}^\infty\frac{du}{u^2+1}=\phi,$$
which in turn can be verified by calculus:
$$\int\_{\frac{\cos\phi}{\sin\phi}}^\infty\frac{du}{u^2+1}=\arctan(\infty)-\arctan\left(\frac{\cos\phi}{\sin\phi}\right)=\frac{\pi}{2}-\left(\frac{\pi}{2}-\phi\right)=\phi.$$
The proof is complete.


