Oscillations of Dielectric Slab in Parallel plate capacitor In the book Principles of Physics by Resnick Halliday:
The decrease in Potential energy of a parallel plate capacitor due to a dielectric is because the slab would start to oscillate and the energy would transfer back and forth between the kinetic energy of the moving slab and potential energy stored in the electric field.
First of, can somebody provide me the math of the SHM and could somebody explain why it would become the potential of the capacitor i.e. the electric field and not the potential of the slab?
As the slab is doing SHM, shouldn't the slab(and not the capacitor) have potential energy at one point of time and kinetic at another like a spring? If the SHM is because of the electric field due to the conducting plates in capacitors, won't they always be in one direction (Plus, it's magnitude is not even a function of distance!)?
Could someone be kind enough to provide the math and the reason for Potential and Kinetic Energy transfer question?
 A: There are two forms of energy in this problem: the kinetic energy of the slab, and the electrical (potential) energy of the capacitor. You can view the latter as being stored in the electric field. I'm not sure what you mean by "the potential of the slab". The E-field through the slab contributes to the electrical energy, but it is still part of the total electrical energy.
The oscillation would resemble that of a spring in some ways: there would be a periodic exchange of kinetic and electrical energy. However you seem to have a misconception about the force causing this oscillation: it is not in the direction of the E-field. The force acts to pull the slab toward the center of the capacitor (it acts "sideways").
To see how this force arises, we can use the method of virtual displacements. Consider the following diagram:

Here I assume that the slab is as long as the capacitor ($L$). Also to make the math tractable, I will neglect all fringing fields (the E-field is assumed to be vertical between the plates and zero everywhere else).
To calculate the force as a function of position, consider a motionless slab first. Energy conservation can be written as
$$\delta W_F + \delta W_e = \delta W_{ext}$$
where $\delta W_F$ is the work done by the force $\vec{F}$ applied on the slab by the E-field, $\delta W_e$ is the change in energy stored in the field and $W_{ext}$ is the energy supplied to the system, e.g. by a voltage supply. The latter could be zero, if there is no external energy source. Suppose the slab is allowed to move a small distance $\delta x$.
$$F \delta x + \delta \left(\frac{1}{2}QV\right) = V\delta Q $$
$$F \delta x = \frac{1}{2}(V\delta Q - Q\delta V)$$
$$F \delta x = \frac{1}{2}\left[V\delta (CV) - Q\delta V\right]$$
$$F \delta x = \frac{1}{2}\left[V^2\delta C + CV\delta V - CV\delta V\right]$$
$$F \delta x = \frac{1}{2}V^2\delta C$$
$$F = \frac{1}{2}V^2\frac{dC}{dx}.$$
$$C = \frac{\epsilon_0w}{d}\left[-x+\epsilon_r(L+x)\right] =\frac{\epsilon_0w}{d}\left[\epsilon_r L + (\epsilon_r - 1)x\right] $$
where $w$ is the width of the capacitor.
$$\frac{dC}{dx} = \frac{\epsilon_0(\epsilon_r - 1)w}{d}$$
$$ F = \frac{\epsilon_0(\epsilon_r - 1)wV^2}{2d}. $$
You can show that the force direction is reversed when $x > 0$, so in general
$$ F = -\text{sign}(x)\frac{\epsilon_0(\epsilon_r - 1)wV^2}{2d}. $$
Note that $V$ is constant only if the capacitor is connected to a voltage supply. If the capacitor is not connected to anything, $Q$ will be constant instead, so you will need to substitute $V=Q/C$.
You see that the force always points toward the center of the capacitor: it acts to increase the capacitance. This force is due to the force applied by the electric field (specifically its horizontal component) on the polarization charges induced in the slab.
The restoring force magnitude is not proportional to the displacement, so the oscillation is not simple harmonic motion. In particular, if $V$ is constant, the acceleration is constant for $x\ne0$, so the position will be a parabolic function of time whenever $x>0$ or $x<0$, like free fall in uniform gravity.
A: The point is that there are two ways of insertion that is with constant potential difference maintained where it doesn't depend on x so it is periodic not shm but in 2nd case it will perform shm as it is dependent on x and directly proportional
