I had asked a previous question with title "How to deal with constants when equating two potential energies?". I didn't get a convincing answer and I kept on pondering it for some days. I think I have got the answer now. Please ensure whether I am right.
There are two closed curves $s$ and $s'$ in space from which arc lengths are measured in a defined direction.
The following symbols have their usual meanings:
\begin{equation} \vec{ds} = \text {element of curve } s\\ \vec{ds'} = \text {element of curve } s'\\ x_0 = \text{displacement of curve $s$ as a whole without rotation along $x$-axis }\\ \epsilon = \text {angle between } \vec{ds} \text{ and } \vec{ds'}\\ r = \text {distance between points on curves } s \text{ and } s'= \text {function of independent variables $s, s', x_0, y_0, z_0$}\\ \rho = \text{function of }r\\ a = \text {an arbitrary constant} \end{equation}
We start with the last equation of previous question:
\begin{align} -\oint^{s'}_0 \oint^{s}_0 \dfrac{\vec{ds}.\vec{ds'}}{r}ii' &=\left[ \left( -\oint^{s'}_0 \oint^{s}_0 \rho \text{ } {\vec{ds}.\vec{ds'}} \right) +a \right] ii'\\ \Rightarrow \oint^{s'}_0 \oint^{s}_0 \dfrac{\vec{ds}.\vec{ds'}}{r} &= \left( \oint^{s'}_0 \oint^{s}_0 \rho \text{ } {\vec{ds}.\vec{ds'}} \right) +a\\ \Rightarrow \oint^{s'}_0 \oint^{s}_0 \dfrac{\vec{ds}.\vec{ds'}}{r} =& \oint^{s'}_0 \oint^{s}_0 \rho \text{ } {\vec{ds}.\vec{ds'}}+ \oint^{s'}_0 \oint^{s}_0 f(s,s') \text{ } {{ds} \text{ } {ds'} \text{ } \cos{\epsilon} }\\ \end{align}
(where $\cos{\epsilon}$ is a function of $s$ and $s'$; and $f(s,s')$ is an arbitrary function of $s$ and $s'$ so that
$a= \oint^{s'}_0 \oint^{s}_0 f(s,s') \text{ } {{ds} \text{ } {ds'} \text{ } \cos{\epsilon} }$)
\begin{align} \tag{1} \Rightarrow \oint^{s'}_0 \oint^{s}_0 \dfrac{\vec{ds}.\vec{ds'}}{r} &=\oint^{s'}_0 \oint^{s}_0 \rho \text{ } {\vec{ds}.\vec{ds'}}+ \oint^{s'}_0 \oint^{s}_0 f(s,s') \text{ } {\vec{ds}.\vec{ds'}}\\ \Rightarrow \oint^{s'}_0 \oint^{s}_0 \dfrac{\vec{ds}.\vec{ds'}}{r} =&\oint^{s'}_0 \oint^{s}_0 \left[ \rho+f(s,s') \right] \text{ } {\vec{ds}.\vec{ds'}}\\ \tag{2} \Rightarrow \frac{1}{r}&=\rho +f(s,s')\\ \Rightarrow \dfrac{\partial }{\partial x_0} \left( \dfrac{1}{r} \right) &=\dfrac{\partial \left[ \rho+f(s,s') \right]}{\partial x_0}\\ \Rightarrow \dfrac{\partial }{\partial x_0} \left( \dfrac{1}{r} \right) &=\dfrac{\partial \rho}{\partial x_0}\\ \Rightarrow \dfrac{d}{dr} \left( \dfrac{1}{r}\right) \dfrac{\partial r}{\partial x_0} &=\dfrac{d \rho}{dr} \dfrac{\partial r}{\partial x_0}\\ \Rightarrow \dfrac{d}{dr} \left( \dfrac{1}{r}\right) \dfrac{\partial r}{\partial s} &=\dfrac{d \rho}{dr} \dfrac{\partial r}{\partial s}\\ \tag{3} \Rightarrow \dfrac{\partial }{\partial s} \left( \dfrac{1}{r} \right) &=\dfrac{\partial \rho}{\partial s}\\ \end{align}
\begin{align} \tag{2} \Rightarrow \dfrac{1}{r}&=\rho +f(s,s')\\ \Rightarrow \dfrac{\partial }{\partial s} \left( \dfrac{1}{r} \right) &=\dfrac{\partial \rho }{\partial s}+\dfrac{\partial [f(s,s')] }{\partial s}\\ \Rightarrow \dfrac{\partial [f(s,s')] }{\partial s}&=0 \end{align} (by $3$)
\begin{align} \Rightarrow f(s,s') &= constant\\ \Rightarrow \oint^{s'}_0 \oint^{s}_0 f(s,s') \text{ } {\vec{ds}.\vec{ds'}} &=f(s,s') \oint^{s'}_0 \oint^{s}_0 \text{ } {\vec{ds}.\vec{ds'}}\\ \Rightarrow a &= f(s,s') \times0 &=0 \\ \end{align}
because $$\oint^s_0 ds \cos {\epsilon}=0$$
