Suppose I have the discrete values $f(x_i)$ for every $x_i$ greater than some $\varepsilon$, and I want to numerically calculate the following integral: \begin{equation} n = \int_\varepsilon^\infty f(x)Z(x)dx \end{equation} with the known function $Z(x)$.
We can approximate $f(x)=f(x_i)$ for $x\in[x_{i-},x_{i+}]$ with $x_{i-}=x_i-\dfrac{\Delta x}{2}$ and $x_{i+}=x_i+\dfrac{\Delta x}{2}$, and calculate the above integral like: \begin{equation} n \approx f(x_k)\int_{\varepsilon}^{x_{k+}} Z(x)dx + \sum_{j=k+1}^{\infty} f(x_j)\int_{x_{j-}}^{x_{j+}} Z(x)dx \end{equation} with $\varepsilon\in[x_{k-},x_{k+}]$. First consider the case of $Z(x)=\sqrt{x-\varepsilon}$, for which the above expression gives a continuously differentiable approximation with respect to $\varepsilon$.
Next, consider another function $Z(x)=c$. We can check and see that the above approximation is no longer differentiable when $\varepsilon$ moves continuously from one $[x_{i-},x_{i+}]$ to the next $[x_{(i+1)-},x_{(i+1)+}]$. In order to have a continously differentiable approximation to $n$, we can use a piecewise linear interpolation for $f(x)$. That is, \begin{align} & f(x) \approx \dfrac{f(x_{j+1})-f(x_j)}{\Delta x}(x-x_j) + f(x_j) \qquad\quad x\in [x_{j-},x_{j+}]~, \\ & n \approx \int_{\varepsilon}^{x_{k+}} f(x)Z(x)dx + \sum_{j=k+1}^{\infty} \int_{x_{j-}}^{x_{j+}} f(x)Z(x)dx \end{align} results in a continuous derivative $\dfrac{dn}{d\varepsilon}$.
Is there some piecewise interpolation for $f(x)$ in order to make the above mentioned numerical approximation continuously differentiable for the function $Z(x) = \dfrac{1}{\sqrt{x-\varepsilon}}$?