Step 1: Use the relation between electric field and potential difference.
The potential difference between two points is given by
\[
V_B-V_A=-\int_A^B \vec{E}\cdot d\vec{r}
\]
Given electric field is
\[
\vec{E}=5x\hat{i}
\]
This means the electric field has only \(x\)-component.
Step 2: Identify coordinates of points.
Point \(A\) lies on the \(y\)-axis at \(y=5\,\text{m}\). Therefore,
\[
A=(0,5)
\]
Point \(B\) lies on the \(x\)-axis at \(x=2\,\text{m}\). Therefore,
\[
B=(2,0)
\]
Since \(\vec{E}=5x\hat{i}\), only displacement in the \(x\)-direction contributes to the line integral.
Step 3: Calculate the potential difference.
We have
\[
d\vec{r}=dx\hat{i}+dy\hat{j}
\]
So,
\[
\vec{E}\cdot d\vec{r}
=
(5x\hat{i})\cdot(dx\hat{i}+dy\hat{j})
\]
\[
\vec{E}\cdot d\vec{r}=5x\,dx
\]
Therefore,
\[
V_B-V_A=-\int_0^2 5x\,dx
\]
\[
V_B-V_A=-5\int_0^2 x\,dx
\]
\[
V_B-V_A=-5\left[\frac{x^2}{2}\right]_0^2
\]
\[
V_B-V_A=-5\left(\frac{4}{2}\right)
\]
\[
V_B-V_A=-10\,\text{V}
\]
Step 4: Final conclusion.
Hence,
\[
\boxed{-10\,\text{V}}
\]