When you put the discharged capacitor in parallel with the charged capacitor, you get an immediate current flow of infinite amps and, that despite your observations about the Dirac impulse (which are not relevant), the infinite current is the root cause of your misunderstanding.
What can be said is: -
- Charge is conserved but,
- Energy is not necessarily conserved (without some care)
To conserve energy you need to avoid making a hard voltage connection to a capacitor. As an example of this, you are probably aware that the energy acquired by a capacitor is \$½\cdot CV^2\$ but, were you also aware that the total energy delivered from a hard voltage source into that same capacitor is \$CV^2\$ i.e. half the energy goes into the capacitor and half the energy is lost.
It doesn't matter how much or little series resistance you place between the hard voltage source and the capacitor, half the energy supplied is lost. Do the math or make a simulation, a large resistor will take longer to charge the capacitor but, will dissipate the same energy as a small value resistor. It doesn't take too much of a thought experiment to realize that this also applies when the resistance is zero ohms (impractical I know).
So, why do we use inductors as the intermediary energy storage device in boost converters - it's for that same reason; we can apply a fixed voltage source to an inductor and it will efficiently take energy from that voltage source then, when that inductor connects to the output capacitor, it also transfers that energy at 100% efficiency. This is because, to impart energy into a capacitor with high efficiency we need to charge it with current and not slap a big voltage across is instantaneously.
But how can I prove this, simply?
It's not that simple mathematically but, if you think of a voltage source that feeds a capacitor via a current regulating circuit, it's easy to demonstrate that the total energy entering the current regulating circuit is twice the energy available in the capacitor. Or, use a simulator and resistors.
To avoid "mistakes", may I recall that, mathematically, infinity∗0 can be ... finite!
This isn't applicable because the capacitor is still a hard voltage source at the moment of connection and therefore the "0" in your equation is actually indeterminate and certainly can't be regarded as zero.
Where is this energy? EDIT: Because energy can't be lost!
I'm sorry, but it can be "lost to the circuit". It turns to heat and that is not recoverable in a simple circuit.
A bit more on energy uptake and a mechanical analogy
Directly charging a capacitor from a voltage supply is inefficient. The energy consumed is C·V² but, the energy stored is only ½ C·V². Consider a 1μF capacitor charged to 1 volt and then connected to a discharged 1μF capacitor. Charge (C·V) is conserved hence, the final voltage is 0.5 volts. For energy there is loss: -
• Initial energy: ½ × 1μF × (1 volt)² = 500 nJ
• Final energy: ½ × 2μF × (0.5 volts)² = 250 nJ
The same happens when objects collide; momentum is conserved but energy is lost.
Inductors are different; all the energy taken from a supply is stored in the magnetic field. Unlike capacitors, inductors don’t cause a current surge. There’s no collision; current ramps up from zero amps in an orderly manner.
Energy is preserved.
Mechanical analogy: if an ideal motor winds up a spring then, all the energy consumed is liberated when the motor is reused as a generator. However, if a spinning motor were “applied” to a flywheel then, the energy acquired by the flywheel is only 50% of the energy taken/consumed by the motor.
There is a collision because the motor has to rapidly (and I mean rapidly) fall to zero rpm.
However, if a flywheel was progressively spun-up from rest then, energy transfer is 100%. Likewise, if a capacitor was charged by a ramping voltage, 100% transfer occurs. Inductors are useful; energy stored can be released into a capacitor with perfect efficiency. A charged inductor connected to a discharged capacitor will ramp the voltage from zero and transfer 100% of the energy to the capacitor.