# Integral on unit disk of a function involving Abs

The goal is to find with Mathematica that $\int\mathrm{d}^{2}z\log|z-u|^{2}$ is $\pi(|u|^2-1)$ for $|u|\leq 1$ and is $2\pi\log|u|$ for $|u|\geq 1$.

NIntegrate confirms this. Integrate[r Log[Abs[r Exp[I t] - u]^2], {r,0,1}, {t,0,2Pi}] is not simplified. Knowing that there are difficulties because Abs is not holomorphic, I replaced the expression with the following locally holomorphic function of r and t. Without Assumptions Mathematica gives a ConditionalExpression that is only defined at u=-I. With Assumptions->0<u<1 one gets a wrong answer that has an extra Log[u] term:

Integrate[
r Log[(r Exp[I t] - u) (r Exp[-I t] - u)], {t, 0, 2 Pi}, {r, 0, 1},
Assumptions -> {0 < u, u < 1}]


gives Pi (-1 + u^2 + Log[u]). This conflicts with the same integral computed for u=1/2, for which Integrate and NIntegrate give -3Pi/4 and its numerical approximation.

How should I compute the integral indicated at the top of my question? What causes the extra Log[u] term? (Probably a bad choice of branch cut.)

In:= ComplexExpand[(r Exp[I t] - u) (r Exp[-I t] - u)]

Out= u^2 - 2 r u Cos[t] + r^2 Cos[t]^2 + r^2 Sin[t]^2

In:= Simplify[%]

Out= r^2 + u^2 - 2 r u Cos[t]

In:= Integrate[ r Log[r^2 + u^2 - 2 r u Cos[t]], {t, 0, 2 Pi}, {r, 0, 1}, Assumptions -> {0 < u, u < 1}]

Out= \[Pi] (-1 + u^2)

In:= Integrate[ r Log[r^2 + u^2 - 2 r u Cos[t]], {t, 0, 2 Pi}, {r, 0, 1}, Assumptions -> {u > 1}]

Out= 2 \[Pi] Log[u]

• Ah, so making the integrand into an expression involving only real quantities before integrating with appropriate assumptions. Thanks! – Bruno Le Floch Jan 17 '18 at 14:07