Capacitor concept

Homework Statement

It's not a typical question but is a challenging question from my sir, That's consider 2 cases:
1- A capacitor connected with a d.c power supply
2- A capacitor (originally charged) with two ends open.

These two cases undergo two changes,1- increase in the plate-to-plate separation.(d)2- decrease in the superimpose area.(A)

In the first case, potential difference across the capacitor is constant
It's given that when d is increased, energy stored in capacitor would decrease,the difference in energy go back to the power supply. In the above process, is any energy needed?(by external force to increase d?) The answer is yes but I can't realise what has happen.
Also, when A is decreased, The energy stored aggain decreases and go abck to the power supply.However, this time no energy is required. Why?

Similarly, for the second case, these two changes would result in an increase in the energy stored in the capacitor, and both of them does requires energy to undergoes changes 1 and 2.

C=Q/V