Suppose I have the discrete values $f(x_i)$ for every discrete value $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}}$?

  • $\begingroup$ did you try with $\sin(x/\Delta x)/x$ ? $\endgroup$
    – N74
    Nov 17 '15 at 12:39
  • $\begingroup$ What do you mean? What exactly is the interpolation between points $x_j$ and $x_{j+1}$? @N74 $\endgroup$ Nov 18 '15 at 10:20
  • $\begingroup$ $\tilde{f}(x)=\sum_{j}^{ }f(x_{j})\Delta x\sin((x-x_{j})/\Delta x)/(x-x_{j})$ is the default interpolation for digital oscilloscopes. You can think it as an inverse continuous Fourier transform of a discrete Fourier transform. $\endgroup$
    – N74
    Nov 18 '15 at 10:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.