Consider the following Logarithmic Sobolev inequality on page 210 of *Analysis* by by Elliott H. Lieb, Michael Loss (GSM 14): for $f\in H^1(\mathbb R^n),$
$$
\frac{a^2}{\pi} \|\nabla f\|_{L^2(\mathbb R^n)}^2 \geq \int_{\mathbb R^n}|f(x)|^2 \ln\frac{|f(x)^2|}{\|f\|_2^2} dx + n(1+\ln a) \|f\|_{L^2}
$$

I am trying to show that equality is achieved for $f = Ce^{-\frac{\pi |x|^2}{2a^2}}.$ Of course, I can easily compute the $L^2$ norm of $f,\nabla f,$ but I cannot see where the constant term $n$ from $n(1+\ln a)$ comes from. It does not seem to cancel with terms inside the first integral in RHS, because $\|f\|_2$ does not contain a factor of $e^n,$ at least in the usual expression for it in terms of gamma function.

After some attempts, I do get very similar expressions for LHS and RHS, but the $n$ never seem to disappear.

How to show that equality holds?