Why does the potential energy of the system decrease when two charge balls are connected using a connecting wire I am confused because I've seen in textbooks and online solutions to questions that when connected,the potential energy of a system of two charged spheres decreases.But according to law of conservation of energy shouldn't it remain the same?
 A: Simple answer is that there is no possibility for the system to gain energy, in any form whatsoever. So it can do two things either loose no energy, or release some energy of heat, assuming ideal behaviour. To prove that it would loose energy if there is any charge transfer consider the following
Initial charge on sphere 1 is $q_1$ and on sphere 2 is $q_2$. The potential energy initially would be
$$k\frac{q_1^2}{2r_1}+k\frac{q_1^2}{2r_2}$$
The factor of half here is due to the assumption that the balls don't interact when left free.
Now after you connect the wires, the charges re-distribute in such a way that they are at the same potentials. Thus we may say
$$\frac{q_1}{r_1}=\frac{q_2}{r_2}$$
If you now write down the total energy after the redistribution (you will have to use conservation of charge as well), you will find out that unless the charges were already in the above ratio, there's always a lots of energy.
Also there is no violation of conservation of energy as the deficit energy has been lost as heat.
A: The energy is lost as heat through the wire resistance. Basically when you connect two conductors at different potentials through a wire they will exchange charge until they have the same potential. Energy is lost in this process but charge is conserved. This will become more clear once you learn about capacitors and current electricity, more specifically RC circuits.
