Work done by electric force is as electric force is constant.
But F(external) on spring mas system is equal to kx. So (equation 1) as external force i.e, electric force is constant.
We know that work done is stored in the form of potential energy and we know that potential energy stored in the spring is .
So (let it be equation 2)
But the above 2 equations are not equal. From where did the 1/2 come from in the 2nd equation?