Explaining the physics of electrostatics problem to a math student I am a mathematician. I know nothing about physics beyond high school. I am reading something about energy problems, and the book has the following interpretation:

The fundamental electrostatics problem concerns the equilibrium
distribution of a unit charge on a conductor. If the conductor is
regarded as a compact set $E$ in the complex plane $\mathbb{C}$ and
charges repel each other according to an inverse distance law, then in
the absence of an external field, equilibrium will be reached when the
total energy $$I(\mu)=\int\int \log\frac1{|z-t|}d\mu(z)d\mu(t) - - - (1)$$
is minimal among all possible charge distributions (measures) $\mu$ on $E$ having
total charge one.


The
introduction of an external field $Q(z)$ in the electrostatics problem
creates some significant differences in the fundamental theory, but
opens much wider doors to applications. The problem now becomes that
of minimizing the weighted energy $$I_{w}(\mu)=\int\int
\log\frac1{|z-t|w(z)w(t)}d\mu(z)d\mu(t) - - - (2)$$ where the weight $w=e^{-Q}$.


*

*Why the energy formula looks like (1)? Where the log comes from?


*In presence of external field why the $I_w(\mu)$ looks like (2) now?


*Can anyone also explain to me through some diagram what the presence of an external field actually mean?
I guess these are all naive questions. I am mostly interested in the math part. But I am very curious to know the exact physics explanation of this fascinating problem
 A: The author is writing energy derived from Coulomb's Gauss's law in two dimensions. I'm not sure how much physics you know, so I'll just take this from the basic start. 
EDIT #2:  This is in two dimensions, so as @MichaelSeifert pointed out, we require a logarithm to describe the electric potential in two dimensions, if we stick to principles from Gauss's law.
EDIT: @GiorgioP pointed out that the logarithm is used as a part of logarithmic potential theory, which provides a mathematical framework for stating this and other problems. A paper by E.B. Saff goes into the mathematical details.
But below is mostly still just the heathen physicist's way of understanding this.

Coulomb's Law
Coulomb's law states that the force between any two point charges is proportional to the inverse square of their distances: $$\mathbf{F}_1 = \frac{q_1q_2}{4\pi\epsilon_0} \frac{\mathbf{r}_1 - \mathbf{r}_2}{{\lvert\mathbf{r}_1 - \mathbf{r}_2\rvert}^3},$$ where $\mathbf{r_1}$ is the position of charge $q_1$ and $\mathbf{r_2}$ is the position of charge $q_2$.
$\mathbf{F}_1$ is the just force felt on charge $q_1$. By Newton's second law, acceleration is proportional to force, with mass as the proportionality constant, such that $$\mathbf{a}_1 = \mathbf{F_1}/m_1,$$ where $m_1$ is the mass of charge $q_1$. You can go through the vector directions and verify that when $q_1$ and $q_2$ have charges of the same sign, the acceleration of $q_1$ will be away from $q_2$, when $q_1$ and $q_2$ have charge of opposite sign, the acceleration of $q_1$ will be toward $q_2$. (You can either swap the labels, or use Newton's third law to determine that $q_2$ feels the same magnitude force directed toward or away from $q_1$.)
Energy from Coulomb's Law
Now, in physics, energy is the ability to do work, and work $W$ is the application of a force over a distance: $$W(t) = \int_{0}^{t}\mathbf{F}(\tau)\cdot\mathbf{x}(\tau) d\tau,$$ where $\mathbf{x}(\tau)$ is just the path a particle takes (parametrized by $\tau$) and $\mathbf{F}(\tau)$ is the force we apply to the particle along that path. We perform the work $W(t)$ over the course of acting on the particle.
We have to "use up" energy $U=W$ in order to perform the work. However, in physics, we have conservation of energy, so this energy actually is deposited into the new configuration of the system. We call this deposited energy "potential energy", because it has the potential to later on do work. For example, if we pull the attractive charges apart, then the system has higher energy, and perhaps can power something in the effort to pull together and reunite. (In real life, this is exactly how a capacitor works.) Repelling charges also can perform work, so it takes energy to bring two repelling charges together.
If we say the system has zero energy when they are infinitely far apart, we can calculate the work to bring the charges from infinite separation to a distance $|\mathbf{r}_1 - \mathbf{r}_2|$ apart, and this ends up being $$U = W = \frac{q_1q_2}{4\pi\epsilon_0}\frac{1}{|\mathbf{r}_1 - \mathbf{r}_2|}.$$
We can drop the proportionality constant by change of units, so we have energy as $$U = \frac{q_1 q_2}{|\mathbf{r}_1 - \mathbf{r_2}|}.\quad\quad\quad (\alpha)$$
If we allow for a continuous charge distribution $\mu(\mathbf{x})$, and restrict to a two-dimensional space such that we can represent position with a complex number, this equation becomes $$U = I'(\mu) = \iint \frac{1}{|z - t|} d\mu(z) d\mu(t).$$
Really Going to Two Dimensions
Gauss's Law in $n$ dimensions
Now,  there is a subtlety here, when we restrict to two dimensions. We started from Coulomb's law, which describes the force particles feel in three dimensions. However, there is a more general principle, Gauss's law, which generalizes how we should describe the electric field in other dimensions.
Gauss's law says that integral of the divergence of the electric field over a volume (of an $n$-dimensional connected space) is equal to the charge that it encloses. Physically, we can think of charges of generating or sinking "electric field lines" of flux, depending on the polarity of the charge.
The equation ($\alpha$) we originally wrote describes a two-dimensional charge distribution that generates field lines that flow out in three dimensions; which can be an interesting problem in and of itself, perhaps to describe the charge distribution of a thin conductive sheet in the real (3D) world.
But if we consider an actual 2D world, the flux lines should also be confined to the 2D plane. But how does this change Coulomb's law?
Modifying Coulomb's law for 2D
Well, because of the divergence theorem, the integral of the divergence over this volume is equal to the surface integral of the electric flux over the boundary. Because the boundary of a 2D volume (an area) is 1D, Gauss's law indicates that in two dimensions we should modify the electric field (and thus the force) to be inverse distance law (rather than the inverse squared distance in 3D).
Performing the same integration of the work of bringing a particle from infinite separation to a fixed distance to another thus produces the logarithm of the distance in the formula for the energy, and thus electric potential (because the integral of $1/r$ is $\log(r) + c$, where $\log$ is the natural logarithm).
This yields energy $$U = q_1 q_2\log{\frac{1}{|\mathbf{r}_1 - \mathbf{r_2}|}}.\quad\quad\quad (\beta)$$
So in a 2D world, to minimize $U$, really we should minimize $$\begin{aligned}I(\mu) &=\iint \log \frac{1}{|z - t|} d\mu(z) d\mu(t),\quad\quad\quad(1)\end{aligned}$$ with respect to the charge distribution $\mu$.
Other things about the logarithm
According to E.B. Saff, you can also describe the integral as the logarithm of a monic polynomial:

for any monic polynomial $p(z) = |Pi^n_{k=1} (z - z_k)$, the function
$\log(1/|p(z)|)$ can be written as a logarithmic potential:
$$\log\frac{1}{|p(z)|} = \int \log\frac{1}{|z-t|}d\nu(t),$$ where $\nu$ is the discrete measure with mass 1 at each of the zeros of $p$. So we can study the logarithm of the monic polynomial, with implications for the problem of interest.

This is related to logarithmic potential theory, which is described well in E.B. Saff's paper.
Incidentally, as I show below, the logarithm also has the nice feature of simplifying (depending on your definition of simple) Equation (2), which describes the energy of a two-dimensional charge distribution in an external field $Q(z)$.
Aside: What's a field?
In this case, the concept of a field is just a simple exercise in separation of variables.
Looking back at $$U = \frac{q_1q_2}{4\pi\epsilon_0}\frac{1}{|\mathbf{r}_1 - \mathbf{r}_2|},$$ we can rewrite it as $$U = q_1 \left(\frac{q_2}{4\pi\epsilon_0}\frac{1}{|\mathbf{r}_1 - \mathbf{r_2}|}\right) = q_1 Q(\mathbf{r}_1; q_2, \mathbf{r}_2) = q_1 Q_2(\mathbf{r}_1).\quad\quad\quad (A)$$ If we arbitrarily fix $q_2$ and $\mathbf{r}_2$, then we see the energy depends simply on where charge $q_1$ is. $Q_2(\mathbf{r})$ is then called the electric potential field produced by charge $q_2$.
Intuitively, we think of the field as being the influence of charge $q_2$ over space: other charges of $q_2$ will feel the influence of $q_2$ influence a lot (and thus be accelerated by it a lot, unless balanced by another force), while charges further away will feel $q_2$ less (and thus be pushed less). If $q_2$ stays put in place, we only need to keep track of the function $Q_2$ to describe this influence.
Because forces add in superposition, if we don't care about how a collection of charges $q_2, q_3, \ldots, q_N$ interacts with itself, but rather only how it affects an external charge such as $q_1$, we can sum up these fields to form an effective total field: $$Q(\mathbf{r}) = \sum_{n=2}^N Q_n(\mathbf{r}).$$
In typical physics lingo, we call $Q(\mathbf{r})$ the electric potential, or the voltage, and would give it the symbol $V$ or $\phi$. (I'm using $Q$ because that's what your problem statement used.) Note that $V$/"$Q$" is a scalar field.
More generally, the word "field" in physics often represents vector fields (of which the scalar field is just a special case, for vector dimension zero). For example, the electric field, which happens to just be the gradient of the electric potential, is one such vector field, and associates three-dimensional electric field vectors for each point in space and time.
Mathematical aside: a vector field is neither (necessarily) a vector space nor a field, in the mathematics sense; but because superposition (i.e. fields from different sources add linearly together) holds in certain cases, they often (also confusingly) do form vector spaces.
Back to the problem (again)
We can write Equation (2) as $$\begin{aligned}U_w = I_w(\mu) &= \iint \left\{\log\frac{1}{|z - t|} + Q(z) + Q(t) \right\}d\mu(z) d\mu(t) \\ &= \iint \frac{1}{|z - t|} d\mu(z) d\mu(t) + 2\int Q(z)d\mu(z)\quad\quad\quad(B)\end{aligned}$$
The condition of $\int d\mu(z) = 1$ allows $Q(z)$ term to simplify to a single integral. We can see that this term of Equation (B) matches Equation (A), except for the factor of $2$; which doesn't change the essential minimization problem (and can be removed simply by scaling our definition of $Q$).
We can simplify the equation to the form in the problem statement by combining some things: $$\begin{aligned}I_w(\mu) &= \iint \left\{\log\frac{1}{|z - t|} + Q(z) + Q(t) \right\}d\mu(z) d\mu(t)\\&=
\iint \left\{\log\frac{1}{|z - t|} + \log e^{Q(z)} + \log e^{Q(t)}\right\}d\mu(z) d\mu(t) \\&= \iint\log\frac{1}{|z - t|e^{-Q(z)}e^{-Q(t)}}
d\mu(z) d\mu(t) \\&= \iint\log\frac{1}{|z - t|w(z)w(t)}
d\mu(z) d\mu(t), \quad\quad\quad (2) \end{aligned}$$
where $w \equiv e^{-Q}$, as defined in the problem statement.
I think that's basically it; let me know if you have any questions in the comments. If you're still confused on what a field is, I can draw up a little diagram or explain it more coherently.
Now, if only you could teach me a little about measure theory in math!
