Some context: over the past two weeks, I have been solving an integral. I completed it last night. However, I just realized that I have essentially shown $$\sum_{k=0}^nf(n,k) = \int_{\mathbf{R}}f(n,x) \, \mathrm{d}x$$ Where $n$ is a fixed non-negative integer.
My question: let $f(t,x)$ be an everywhere-differentiable real-valued function of $x$ where $t$ is a non-negative integer. Further, let it be such that $f(t,x)$ cannot be written as $g(t)h(x)$. Is there any general way to go about determining whether $$\sum_{k=0}^nf(n,k) = \int_{\mathbf{R}}f(n,x) \, \mathrm{d}x$$ For all $n=0,1,2 \dots$? I ask because I can find quite a few functions which both do and do not satisfy the above, and am wondering whether the the work I just did was unnecessary.