HEY LOOK............
WHEN A DIELECTRIC IS PUSHED
TWO CAPACITANCES ARE FORMED............
THAT IS.........
LET b be width that remains constant now l be length........
therefore c1= b(l-x)
C2= bkx

/D.........
C=C1+C2...........
U=1/2CV2
F= -dU/dx
F= -1/2V2dC/dx
bcoz only capaccitance is changing ...........
as ur answer is compete.............
but
FORCE=Keb V2(K-1)/2d
okkkkkkkkkkkkkk
hope u understands
there will be no effect of gravity..........i think so