Let $J_{0}(x)=\frac{1}{\pi}\int_{0}^{\pi}\cos(x\sin(t))dt$, $\forall x\in \mathbb{R}$. We need to approximate it by polygonals, that's it, a set of equally spaced point $\{x_{i}\}_{i\in\mathbb{Z}}$, with $x_{i}-x_{i-1}=h>0$. And a function $f$, with $f(x)=\frac{x_{i}-x}{x_{i}-x_{i-1}}x_{i-1}+\left(1-\frac{x_{i}-x}{x_{i}-x_{i-1}}\right)x_{i}$, $\forall x\in[x_{i-1},x_{i}]$. The aim is to find the greatest $h>0$ such that $\sup_{x\in\mathbb{R}}|J_{0}(x)-f(x)|<10^{-6}$.
I've tried with variable substitution, and I was looking for the derivative of the bessel function, but seems that I'm stuck.