# Approximating $C^2$ functions with compactly supported $C^2$ functions

Let $C^2$ be the space of twice-continuously differentiable functions from $\mathbb{R}^n$ to $\mathbb{R}$ and $C^2_K$ be the subset of functions in $C^2$ with compact support (that are zero outside some compact set). Given any $f\in C^2$ can we always find a sequence $(f_n)\subset C^2_K$ such that

$$f_n(x)\to f(x),\quad\quad \frac{\partial f_n}{\partial x_i}(x)\to \frac{\partial f}{\partial x_i}(x),\quad\quad \frac{\partial^2 f_n}{\partial x_i\partial x_j}(x)\to \frac{\partial^2 f}{\partial x_i\partial x_j}(x)$$

as $n\to\infty$ for every $i,j$ and $x\in\mathbb{R}^n$ and such that

$$|f(x)|+\sum_{i}\left|\frac{\partial f_n}{\partial x_i}(x)\right|+\sum_{i,j}\left|\frac{\partial^2 f_n}{\partial x_i\partial x_j}(x)\right|\leq \alpha\left(|f(x)|+\sum_i\left|\frac{\partial f}{\partial x_i}(x)\right|+ \sum_{i,j}\left|\frac{\partial^2 f}{\partial x_i\partial x_j}(x)\right|\right)+\beta$$

for every $x\in\mathbb{R}^n$ and some constant (independent of $n$) $\alpha,\beta\geq0$? Or do we need some extra assumptions on $f$?

What about the if we replace $C^2$ with the space of smooth functions $C^\infty$ and $C^2_K$ with the space of compactly supported smooth functions $C^\infty_K$?

My initial thought was setting $f_n(x):=e^{-||x||_1/n}f(x)$, however these are not smooth (differentiability fails at $x=0$) and I couldn't then see how to approximate the $f_n$ with functions in $C^2_K$ (or $C^\infty_K$)).

Any references to a source where this type of results are discussed are very welcome.

• Not a bad idea, actually. Instead of exponential, fix a bump function $\phi$ such that $\phi\equiv 1$ in some neighborhood of $0$. Then let $f_n(x) = \phi(x/n) f(x)$ and see what happens to the derivatives. – user127096 Mar 30 '14 at 21:05
• Are you after the point-wise or uniform convergence? For $\forall x$ or $x=0$ only? If for all x you could approximate function locally with splines and blend them together with the partition of unity bump function. – rych Apr 1 '14 at 7:57
• @cheapeffectivedietpills, thanks this works perfectly (for example, with $\phi(x)=\exp(1-1/(1-x^2))$ if $|x|<1$ and zero otherwise). If you copy paste your comment into an answer box, I'll accept and we can close the question. – jkn Apr 1 '14 at 11:48
• @Igor, thank you for the comment. I just needed pointwise convergence, and cheap effective diet pills's suggestion seems to do the trick. Sorry I'm not sure how to follow through with your suggestion (not familiar with how to "blend spines together with the partition of the unity bump function"). – jkn Apr 1 '14 at 11:52
• sorry, my rushed comment was neither here nor there, I wish I could erase it now. It is interesting though that you only want the approximation around $x=0$. Having solved it with a bump function, maybe you could briefly edit or comment what indeed happens with the derivatives, do they converge or maybe even equal to that of $f$ at 0. – rych Apr 2 '14 at 6:59