Turning sum into integral when the widths of the intervals are not uniform I have a sum of the form
$$ S = \sum_\lambda f(\lambda), $$
where the "index" of the sum solves the equation
$$ \tan(C \lambda) = \lambda.$$
This equation has a countably infinite number of solutions. One can see that as $C$ gets large, these solutions get closer and closer together, so it should be possible to express $S$ as an integral as $C \rightarrow \infty$, but I am unclear how to achieve this.
How can I introduce the vanishing width of the intervals into the sum to make a Riemann-type sum for $S$?
Attempt:
Set
$$ S =  \lim_{N\rightarrow \infty}\sum_{n=-N}^N f(\lambda_n) $$
where $\tan(C\lambda_n) = \lambda_n$ and the $\lambda_n$ are sorted ($\lambda_{n-1}< \lambda_n$ for all $n$).
Then
$$ S = \lim_{N\rightarrow \infty} 2N\sum_{n=-N}^N f(2N\frac{\lambda_n}{2N})\frac{1}{2N} \sim \lim_{N\rightarrow \infty} 2N\int_{-N}^N f(2Nz)dz $$
Is this correct? Or am I missing something here? I suppose there are some strong constraints required on $f$ such that $S$ converges.
 A: We prove:

Claim. Consider $f : \mathbb{R} \to \mathbb{R}$ such that

*

*$f$ is locally Riemann integrable on $\mathbb{R}$, that is, $f$ is Riemann integrable on each closed bounded subinterval of $\mathbb{R}$,


*$\phi(r) = \sup_{|x| \geq r} |f(x)| $ is integrable on $[0, \infty)$.
Then we have
$$ \lim_{C \to \infty} \frac{1}{C} \sum_{\lambda : \tan(C\lambda) = \lambda} f(\lambda) = \frac{1}{\pi} \int_{-\infty}^{\infty} f(x) \, \mathrm{d}x. $$

For the proof, if $C > 1$ then we note that the equation $\tan(C\lambda) = \lambda$ has a unique solution $\lambda_n$ in each interval $I_n = [\frac{n\pi}{C}-\frac{\pi}{2C}, \frac{n\pi}{C}+\frac{\pi}{2C}] $. This allows us to write
$$ \sum_{\lambda : \tan(C\lambda) = \lambda} f(\lambda) = \sum_{n\in\mathbb{Z}} f(\lambda_n), $$
provided the sum converges absolutely.
1. From this, for each fixed $r > 0$,
$$ S_{C,r} := \sum_{n\in\mathbb{Z}} f(\lambda_n) \operatorname{length}(I_n \cap [-r, r]) $$
is a Riemann of $f$ over $[-r, r]$. (Even though the index $n$ runs over the infinite set $\mathbb{Z}$, only finitely many terms are non-zero and hence $S_{n,r}$ is essentially a finite sum.) Also, the mesh of the associated tagged partition decreases to $0$ as $C \to \infty$, and so, we have
$$ \lim_{C\to\infty} S_{C,r} = \int_{-r}^{r} f(x) \, \mathrm{d}x. $$
2. On the other hand, for $|n| \geq 2$,
$$ \Bigl( \sup_{I_n}|f| \Bigr) \operatorname{length}(I_n)
\leq \phi\biggl( \frac{|n|\pi}{C}-\frac{\pi}{2C} \biggr) \operatorname{length}(I_n)
\leq \int_{\frac{|n|\pi}{C}-\frac{3\pi}{2C}}^{\frac{|n|\pi}{C}-\frac{\pi}{2C}} \phi (x) \, \mathrm{d}x, $$
and so, if $C$ is sufficiently large so that $r > \frac{5\pi}{2C}$, then
$$
\sum_{n\in\mathbb{Z}} | f(\lambda_n) | \operatorname{length}(I_n \setminus [-r, r])
\leq 2\int_{r-\frac{5\pi}{2C}}^{\infty} \phi (x) \, \mathrm{d}x.
$$
This in particular shows that the sum $\sum_n f(\lambda_n)$ converges absolutely.
3. On the other hand, since $|f(x)| \leq \varphi(|x|)$ and $\varphi(|x|)$ is integrable on $\mathbb{R}$, $\int_{-\infty}^{\infty} f(x) \, \mathrm{d}x$ converges absolutely. Moreover, it is clear that
$$ \left| \int_{|x|\geq r} f(x) \, \mathrm{d}x \right| \leq 2 \int_{r}^{\infty} \varphi(x) \, \mathrm{d}x. $$
4. Finally, combining all the observations, we find that
$$ \limsup_{C\to\infty} \, \Biggl| \frac{\pi}{C} \sum_{\lambda : \tan(C\lambda) = \lambda} f(\lambda) - \int_{-\infty}^{\infty} f(x) \, \mathrm{d}x \Biggr|
\leq 4\int_{r}^{\infty} \phi (x) \, \mathrm{d}x $$
Since this is true for any $ r > 0$, letting $ r\to \infty$ proves the desired claim.
