I want to construct a piecewise function to approximate the function $f:[0,1]^d \to \mathbb{R}, ~f(x) = \exp(\|x\|^2)$. My approach is to partition the space $[0,1]^d$ into non-overlapping cubes $B_1,\dots B_m$ with centers $b_1,\dots, b_m$ and radii $\delta_1,\dots, \delta_m$, and define the piecewise function by
$$g(x) = \sum_{j=1}^m e^{\|b_j\|^2} 1\{{x \in B_j}\}.$$
So for each $B_j$, we approximate $f(x)$ by it's value at the center $f(b_j)$. I want to choose $m$ large enough (or equivalently, the width of the $B_j$'s small enough) to ensure something like: for any $x \in D = [0,1]^d$
$$c_1 g(x) \le f(x) \le c_2 g(x),$$so that my approximation is off by at most a constant factor. I'm struggling with the details though. My idea was to use the mean value theorem:
\begin{align*}\sup_{x\in B_j} |f(x) - g(x)|&=\sup_{x\in B_j} |f(x) - f(b_j)|\\&\le \sup_{x \in B_j}\|\nabla f(x)\| \|x - b_j\|\\&\le \sqrt{d}\delta_j \sup_{x \in B_j}\|\nabla f(x)\|\\&=\sqrt{d}\delta_j \sup_{x \in B_j}2\|x \|\exp(\|x\|^2)\\&=\sqrt{d}\delta_j 2\|b_j + \delta_j \|\exp(\|b_j + \delta_j\|^2)\end{align*}We should then pick $\delta_j$ small enough to ensure that the final expression is smaller than $f(x)/2$. This would ensure something like$$\sup_{x\in B_j} |f(x) - g(x)| \le f(x)/2 \implies \frac{2}{3}g(x) \le f(x) \le 2g(x).$$
To that end, we need to solve for $\delta_j$ satisfying:$$\sqrt{d}\delta_j 2\|b_j + \delta_j \|\exp(\|b_j + \delta_j\|^2) \le \frac{1}{2} \exp(\|b_j\|^2).$$Which I'm struggling to solve.
- Is this approach reasonable?
- If yes, how would I go about solving for $\delta_j$?
- Does this approach guarantee to get the smallest choice of $m$ possible? or are there better alternatives?