Why don't these two methods of finding the electric potential in a semicircle agree? I was given the following problem:

A wire of finite length that has a uniform linear charge density $λ = 5.51\times 10^{-9}\ \mathrm{C/m}$ is bent into a semi-circle. Find the electric potential from the center of the semi-circle. 

After trying it myself and seeing several examples on the internet, I've seen that the typical way to approach this problem is from the formula
$$V = \int \frac{k\,\mathrm{d}q}{r}\tag{1}$$
where $λr\,\mathrm{d}\theta$ is substituted for $\mathrm{d}q$. The integral is bounded from $0$ to $\pi$, resulting in $kλ\pi$.
However, when I first solved this problem, my instinct was to use another approach:
$$V = -\int \vec{E}\,\mathrm{d}s\tag{2}$$
I knew from previous exercises that the electric field of a semi-circle is given by $-2kλ/R$, which when inputted into the electric potential formula in terms of electric field, gives a $V$ of $2kλ\pi$.
This second value is off from the first by a factor of two, when the two values should be the same. Why don't these methods agree?
 A: Actually you've got that latter formula wrong. It's
$$\Delta V = -\int \vec{E}\cdot\mathrm{d}\vec{s}$$
The $\Delta$ is important. It reflects the fact that you are calculating a change (or difference) in potential between two points, not the potential at a point, as you are being asked for in this problem. So you can't use that equation. It simply does not apply to the physical situation you're dealing with.
The integral in this equation is a path integral, too, which means you integrate along some path running between the aforementioned two points, not along the path where the charge is.
A: 1. Point of zero potential
To compare the values of potentials found by two different methods, we must answer to the ACuriousMind's comment under your question :


  The electric potential is only defined up to an overall constant, defined by the point of zero potential. Could you explicitly write out where you put the point of zero potential in your two methods? 
  

In electrostatics the potential $\:V(r)\:$ at a radial distance from a rest point electric charge $\:Q\:$ is
\begin{equation}
V(r)=k\dfrac{Q}{r}
\tag{A-01}
\end{equation}
It's obvious that the point of zero potential is at  $\:r \rightarrow \infty\:$, so the potential at the center $\:\mathrm{K}\:$ of the semi-circle due to this semi-circle (see Figure)
\begin{equation}
V_{\mathrm{K}}=\int\limits_{\rm{semi-circle}}k\dfrac{\mathrm{d}q}{R}=\int\limits_{0}^{\pi}k\dfrac{\lambda R}{R}\mathrm{d}\theta=k\lambda\pi
\tag{A-02}
\end{equation}
has as reference the same  point of zero potential at  $\:r \rightarrow \infty$.

2. The potential by the path integral approach
We'll try to find the potential $\:V_{\mathrm{K}}\:$ at the center $\:\mathrm{K}\:$ of the semi-circle by the path integral of the electric intensity vector $\:\mathbf{E}(\mathbf{r})\:$. But to compare the result with that in equation (02) we must refer to the same point of zero potential. So we choose any curve $\:\textrm{C}\:$ starting from  the center $\:\mathrm{K}\:$ and extending to $\:r \rightarrow \infty$ : 
\begin{equation}
V_{\mathrm{K}}=-\int\limits_{\rm{C}}\mathbf{E}(\mathbf{r})\boldsymbol{\cdot}\mathrm{d}\mathbf{r}=-\int\limits_{\infty}^{\mathrm{K}}\mathbf{E}(\mathbf{r})\boldsymbol{\cdot}\mathrm{d}\mathbf{r}
\tag{A-03}
\end{equation}
Note that the result would be independent of the chosen curve $\:\textrm{C}$.
Now, for many obvious reasons it's convenient to choose as curve $\:\textrm{C}\:$ the non-negative $\:y-$axis. At any point of this axis not only the component $\:\mathrm{E}_{x}\:$ is normal to the $\:y-$axis not contributing to the integral, but also is zero because of the symmetry with respect to this axis. So
\begin{equation}
V_{\mathrm{K}}=-\int\limits_{+\infty}^{\mathrm{K}}\mathbf{E}(\mathbf{r})\boldsymbol{\cdot}\mathrm{d}\mathbf{r}=+\int\limits_{y=0}^{y=+\infty}\mathrm{E}_{y}\mathrm{d}y
\tag{A-04}
\end{equation}
Now the infinitesimal $\:\mathrm{d}\mathrm{E}_{y}\:$ due to the infinitesimal arc $\:R\mathrm{d}\theta\:$ is
\begin{equation}
\mathrm{d}\mathrm{E}_{y}=k\dfrac{\lambda R \mathrm{d}\theta}{\mathsf{z}^{2}}\cos\phi
\tag{A-05}
\end{equation}
From the triangle $\:\mathrm{KAP}\:$ we have
\begin{align}
\mathsf{z}^{2} & = y^{2}+R^{2}+2Ry\sin\theta
\tag{A-06}\\
\cos\phi & = \dfrac{y^{2}+\mathsf{z}^{2}-R^{2}}{2\,\mathsf{z}\,y}
\tag{A-07}
\end{align}
Inserting (A-06), (A-07) in (A-05) we have
\begin{equation}
\mathrm{d}\mathrm{E}_{y}=k\lambda R \dfrac{y+R\sin\theta}{\left(y^{2}+R^{2}+2Ry\sin\theta\right)^{3/2}}\mathrm{d}\theta
\tag{A-08}
\end{equation}
and
\begin{equation}
\mathrm{E}_{y}=\int\limits_{\theta=0}^{\theta=\pi}k\lambda R \dfrac{y+R\sin\theta}{\left(y^{2}+R^{2}+2Ry\sin\theta\right)^{3/2}}\mathrm{d}\theta
\tag{A-09}
\end{equation}
I  don't think that there exists analytic expression for above integral with respect to $\:\theta$(1). So the trick here is to insert this expression in (A-04) and reverse the order of integration 
\begin{align}
V_{\mathrm{K}}=\int\limits_{y=0}^{+\infty}\mathrm{E}_{y}\mathrm{d}y & =\int\limits_{y=0}^{+\infty}\left(\:\int\limits_{\theta=0}^{\theta=\pi}k\lambda R \dfrac{y+R\sin\theta}{\left(y^{2}+R^{2}+2Ry\sin\theta\right)^{3/2}}\mathrm{d}\theta\right)\mathrm{d}y\\
& =\int\limits_{\theta=0}^{\theta=\pi}\left(\:\int\limits_{y=0}^{+\infty}k\lambda R \dfrac{y+R\sin\theta}{\left(y^{2}+R^{2}+2Ry\sin\theta\right)^{3/2}}\mathrm{d}y\right)\mathrm{d}\theta
\tag{A-10}
\end{align}
Now we have analytic expression for the indefinite integral with respect to $\:y$
\begin{equation}
\int\dfrac{y+R\sin\theta}{\left(y^{2}+R^{2}+2Ry\sin\theta\right)^{3/2}}\mathrm{d}y=-\dfrac{1}{\left(y^{2}+R^{2}+2Ry\sin\theta\right)^{1/2}}+\rm{constant}
\tag{A-11}
\end{equation}
So,
\begin{equation}
\int\limits_{y=0}^{+\infty}\dfrac{y+R\sin\theta}{\left(y^{2}+R^{2}+2Ry\sin\theta\right)^{3/2}}\mathrm{d}y=-\left[\dfrac{1}{\left(y^{2}+R^{2}+2Ry\sin\theta\right)^{1/2}}\right]_{y=0}^{y=+\infty}=\dfrac{1}{R}
\tag{A-12}
\end{equation}
and from (A-10)
\begin{equation}
V_{\mathrm{K}}=\int\limits_{\theta=0}^{\theta=\pi}\left(k\lambda R \dfrac{1}{R}\right)\mathrm{d}\theta=k\lambda \pi
\tag{A-13}
\end{equation}
in agreement with (A-02).

(1) This integral can be calculated in the special case $\:y=0\:$ :
\begin{equation}
\mathrm{E}_{y=0}=\int\limits_{\theta=0}^{\theta=\pi}k\lambda R \dfrac{R\sin\theta}{R^{3}}\mathrm{d}\theta=\dfrac{k\lambda}{R}\Bigl[-\cos\theta\Bigr]_{\theta=0}^{\theta=\pi}=\dfrac{2k\lambda}{R}
\tag{A-14}
\end{equation}

