Note on the above illustration
Many books give this example but state that the string is pulled up, over the wheel, while the pendulum is swinging. This is a more complex situation. As the pendulum swings, it generates a centrifugal force, and the pull on the string, besides lifting the weight to a higher average position (which increases the potential energy), also has to overcome the resistance of the centrifugal force. That requires an extra input of energy from the force pulling the string, and since energy has to go somewhere, it makes the swing of the pendulum more vigorous.
That is somewhat similar to the case of the lowered support, but the calculation gives a diferent rate. With the lowered support, work is also done--but that happens when the weight is pulled in from the sides to swing in a shorter arc, not at the bottom of the swing.
The process described here is related to the way children "pump" a swing to make it go higher. The child moves arms, legs and body in a way that works against the centrifugal force, and the energy invested in overcoming this force ends up producing a more energetic swinging motion.
(This is a highly simplified explanation and assumes that from the point of view of the child in the swing, nature behaves exactly the same as anywhere else, only a centrifugal force is added. The actual situation can be more complicated.)
The "Exploratorium" science museum in San Francisco has a small swing (too small to carry a person) that can be "pumped" from the outside. The seat of the swing, instead of hanging by two ropes or chains, is attached to the axis by two smooth parallel rods.
Above the regular swing seat is a second seat, with two wide holes threaded by the two rods. Under normal circumstances, the second seat will drop to the bottom, on top of the regular one. However, a rope is connected to its middle, going over the bar from which the swing hangs and down again, and a person standing next to the swing can pull that string or let it go, making the second seat rise along the rods or fall down again.
With your hand, you set the swing moving with moderate motion. Now, by pulling the rope or letting go at suitable times in the oscillation, you can easily "pump up" the motion. You only need to pull the swing up when it passes the lowest part of its motion, and let it down again at the extreme ends of its motion, when for a brief instant it is at rest.