Since \( \vec{E} = 5x\, \hat{i} \), the electric field varies with \( x \) only.
So, potential difference:
\[
V_B - V_A = -\int_A^B \vec{E} \cdot d\vec{r}
\]
Point A lies on the y-axis → \( x = 0 \), and point B is on x-axis at \( x = 2 \)
\[
\Rightarrow V_B - V_A = -\int_0^2 5x\, dx = -\left[\frac{5x^2}{2}\right]_0^2
= -\frac{5 \cdot 4}{2} = -10\, \text{V}
\]