Suppose an electric field as depicted in the picture
E∝yE=ky
Now when we take a charge +q along the path ABCDA, Then :
WAB=qky2LWBC=0(Since, displacement is perpendicular to the field)WCD=−qky1LWDA=0(Since, displacement is perpendicular to the field)
Total work done :
W=WAB+WBC+WCD+WDAW=qky2L+0−qky1L+0W=qkL(y2−y1)
Now if y2≠y1, then W≠0 Which implies that such particular sort of electric field would act non-conservatively.
Since it can be easily asserted that such a field is impossible as it does not follow that static electric field must be conservative, I have done the derivative for a estabilised field of line charge here.