Related with my previous question, i want to ask about how to represents the numerical inverse laplace transform using Trapezoidal's rule. Please see here to revisit my previous question:
Writing The Real Part of Complex Integrand
Here's the final result of inverse Laplace transform with Fixed-Talbot's method as i mentioned in my previous question: $$f(t) =\frac{r}{\pi} \int_0^{\pi} \Re \left[e^{ts(\theta)}\hat{f}(s(\theta))(1+i\sigma(\theta))\right]\Bbb d\theta$$
And my confusion is come when my textbook said with the application of Trapezoidal's rule we get the following:
$$f(t) \approx \frac{r}{M}\left(\frac12 re^{rt}\hat{f}(r)\sum_{k=1}^{M-1} \Re \left[e^{ts(\theta_k)} \hat{f}(s(\theta_k))(1+i\sigma(\theta_k))\right]\right)$$
In case to recall the Trapezoidal's rule, i give the following picture taken from Wikipedia:
Main Question:
I have difficulty to understand this part:
$$f(x_0) + f(x_N) = re^{rt}\hat{f}(r)$$
Since the bounds is $(0,\,\pi)$, "maybe" i could agree if $f(0)=0$ so we can ignore that one. Now our new main discussion is, how and what is the explanation of $$f(\pi) = re^{rt}\hat{f}(r)$$
To understand what $r$ is, please consider the following picture that represents the Talbot's contour and for our case treat $\sigma=0$, $\nu=1$, and $\lambda=r$.

Conclusion
I need to know why is $f(x_N=\pi) = re^{rt}\hat{f}(r)$. By the way, let me know if my assumption for $f(0)=0$ is wrong. And as always, Thanks in advance!
Edit: i realized both $0$ and $\pi$ make the integrand undefined (because $\cot(0)$ and $\cot(\pi)$ are not defined). It means the function is on the open interval $\theta\in(0,\pi)$. As mentioned on the given link above, we have
$$s(\theta) = r\theta(\cot(\theta)+i),$$
$$s'(\theta) = ir(1+ i\sigma(\theta)),$$
and
$$\sigma(\theta) = theta + \theta(\cot(\theta) - 1)\cot(\theta)$$
And if my guess is true Then,
if $f$ is a real function on the open interval $(a,b)$ then there is a constant $c$ which may be inside the interval or outside such that
$$\lim_{x_0\to a} f(x_0) + \lim_{x_N\to b} f(x_N) = f(c) $$
For instance suppose $x_0=0$, $x_N=2$, and $f(x)=x$ then $f(0)+f(2)=0+2=2=f(2)$. In this case $c=2$. Can we generalize it on other functions?
(maybe you are familiar with this question because I posted this question before but they voted for my question to be closed because I didn't provide anything in detail.)
You can always ask me in the comment if i need to add something on my question to make it easy to understand. Thank you.
