9

Could anyone give me a function infinitely differentiable on the real line and having a compact support? And the function must be nonnegative and normalized, i.e. the integration of the function on the real line must be one.

I tried to think of one myself, but it seems trickier than expected.

Keith
  • 7,673
  • 3
    You need to construct such a function out of a function such as $$f(x)=\begin{cases} e^{-1/x}, & x>0 \ 0, & x\le 0\end{cases}.$$ – Ted Shifrin May 15 '15 at 16:56
  • I tried, but couldn't satisfy the compact support condition. – Keith May 15 '15 at 16:57
  • 3
    Ah, build another one, $g$, that dies smoothly at $x=1$, say, and then what can you do with the two of them? – Ted Shifrin May 15 '15 at 16:58
  • What about the function $f(x)=0$ for all $x$? – Michael May 15 '15 at 16:58
  • Oh, sorry I forgot to put another condition that the function must be normalized. I made an edit. – Keith May 15 '15 at 16:59
  • @TedShifrin and Merideth , This type of question always makes me think of ODEs spontaneously generating interesting solutions out of zero initial conditions, and the world springing into existence out of nothing. – Michael May 15 '15 at 17:04
  • 2
    @Merideth: Everyone is doing the problem for you, but if you want to try to solve by thinking through what I said, do so, and then worry about normalizing the integral once you're done. – Ted Shifrin May 15 '15 at 17:06

3 Answers3

9

The classic bump function is nice: $$f(x)=\begin{cases} e^{-\frac{1}{1-x^2}} & \textrm{if }|x|<1 \\ 0 & \textrm{otherwise}\\ \end{cases}$$

I doubt it's normalized, but you just need to divide it by $\int_{-1}^{1}f(t)\;dt$ to normalize.

MPW
  • 43,638
  • Is f continuous ? As you have given differentiable so it should be but I not able to understand , can you please explain? – Siddharth Feb 17 '17 at 05:50
7

Let $a, r\ (r>0)$ be numbers. The function: $$f(x)=\begin{cases}\mathrm e^{\tfrac1{(x-a)^2-r^2}}&\text{if}\enspace \lvert x-a\rvert <r\\ 0&\text{if}\enspace \lvert x-a\rvert\ge r\end{cases},$$ is an example of a $\mathcal C^\infty$ function with support in $[a-r,a+r]$.

Bernard
  • 175,478
6

Fix $\varepsilon>0$ as small as you want and take $\frac{f}{\|f\|_{L^1}}$ with $$f(x)=\begin{cases}1&-\varepsilon\leq x\leq \varepsilon\\ \exp\left(-\frac{(|x|-\varepsilon)^2}{4\varepsilon^2-x^2}\right)&\varepsilon\leq |x|\leq 2\varepsilon\\ 0&|x|\geq 2\varepsilon \end{cases}.$$

Here an example for $\varepsilon=1/2$ ($f$ is not normalized): enter image description here

Nicolas
  • 3,326