0

I would like to find a $C^2$ function $g:\mathbb{R}\rightarrow[0,1]$ such that

$g|_{[-1,1]}=1$ and $g(x)=0$ for $|x|>2.$

I know that being $C^2$ means that the second derivative of $g$ must exist and be continuous, but I find it hard to find one that satisfies the condition. I think a polynomial wouldn't work here but something with a cosine might, although I'm not sure how.

2 Answers2

0

Consider the polynomial $$P(x)=(6x^2+3x+1)(1-x)^3$$ then $P([0,1])=[0,1]$, $P(0)=1$, $P(1)=0$, $P'(0)=P''(0)=P'(1)=P''(1)=0$. Then a function $g$ which satisfies your conditions is $$g(x) = \left\{\begin{array}{ll} 1 & \text{for } x\in[-1,1]\\ P(|x|-1) & \text{for } x\in[-2,-1]\cup[1,2]\\ 0 & \text{otherwise} \end{array}\right. $$

Robert Z
  • 145,942
0

Define

$$f(t) = 2\sin^2(\pi t)\cdot\chi_{[-2,-1]}(t) - 2\sin^2(\pi t)\cdot\chi_{[1,2]}(t).$$

Then $f\in C^1(\mathbb R),$ $f$ is odd, and $\int_{-2}^{-1}f(t)\,dt = 1.$ Now set

$$g(x) = \int_{-\infty}^x f(t)\, dt.$$

Then $g$ satisfies the requirements.

zhw.
  • 105,693