When two conservation laws come into conflict
Everyone knows the capacitor and that it can be used to store energy. If its capacitance is C and the charge accumulated on its plates is Q, then the amount of energy stored in the capacitor is equal to Q2/2C. Observe the characteristic coefficient: 1/2. Naively one might assume, that if the voltage on the plates is Q/C, then the energy should be equal to the product of the voltage Q/C and the charge Q, which would yield Q2/C.
The explanation is quite simple. If we were to draw electricity from the capacitor and thus gradually discharge it, the voltage would be falling down; thus only the initial charge portions would have voltage Q/C, whereas the final ones would go through a difference of potentials tending to zero. The mean voltage would then be equal to (1/2)(Q/C + 0) and this is the reason for the appearance of the coefficient 1/2 in the total energy formula. The same mechanism stands behind the appearance of an analogous coefficient in the formulae for the energy of a strained spring, for the distance in a uniformly accelerated motion and for many other phenomena. This is the very coefficient a certain priest had in mind when after being hit on the head by a falling flower-pot he sighed thankfully: "Be praised, my Lord, for making kinetic energy equal to only half of mv2!"
Let's prepare two identical capacitors and let only one of them be initially charged. What would happen if we joined the two? Undoubtedly both the energy and the charge would distribute between both capacitors. Being identical, at the end of the process they would have equal energies and charges. Keeping in mind the conservation laws for energy on the one hand and for the charge on the other, we might expect that the charge on each of the capacitors be equal to Q/2 and the energy be Q2/4C. Alas, this is impossible! Indeed, substituting Q/2 into the general capacitor energy formula we get Q2/8C. Multiplying this latter value by 2 (we have two capacitors, don't we?) the total energy we get is only half of the initial value. If we assume that the final total charge is equal to the initial one, we somehow lose half of the energy. On the other hand, if we insisted on conserving the energy, the charge would have to increase beyond understanding.
Which conservation law is to be given priority in our example? It seems to be quite clear that the charge must have it. There is no human force able to destroy it or to create it, there is no way of hiding a charge or overlooking it.
Well, obviously, the energy cannot be destroyed either. However, it may assume so many different forms, that a superficial analysis may easily overlook some mechanisms of its transformation. This is exactly what happened in our case. If instead of joining directly the plates of the two capacitors we used a conductor with a given electric resistance (as in the figure), the escape of energy would be more visible, if not obvious. Electricity would flow in the process of balancing the electric forces (and the charges) and the resistor would give off heat (Joule-Lenz). It may seem that the loss of heat can be reduced by making the resistance small, but this is just an illusion. The heat released in the process can be easily computed to prove that its value does not depend on the resistance and that, obviously, its value corresponds exactly to the loss of electrostatic energy with respect to the initial energy value.
The computation needed to arrive at this result is very simple. In particular, there is no need at all to determine the discharge distribution in time. Just observe that when a charge X is transferred from the plate of one capacitor to the plate of the other, the voltage in the first decreases by X/C and that in the second increases by the same value. Thus the difference of potentials at both resistor ends decreases by 2X/C. During the process the transfer of half of the initial charge causes a (linear with respect to X) voltage drop on the connecting resistor, going from the initial value of Q/C to the final value 0. Thus the mean voltage is equal to Q/2C and the transfer of a charge Q/2 releases (Q/2)(Q/2C) of heat, i.e. exactly the amount of energy we "lost" in our first computation.
This solution of the not very complex paradox presented in the beginning does not completely solve the problem. In fact, it is correct only if we ignore the inductance of the loop formed by the two capacitors and the conductors which join them (even if these are reduced to mere tips). Moreover, other phenomena may appear, like sparking, electromagnetic waves or noises. In any case, one thing remains beyond any doubt: in each particular case exactly one half of the initial electrostatic energy will be dissipated into the environment.