Approximation of a continuous non-negative function by $C^1$ functions with compact support

205 Views Asked by At

Let $f:[a,b]\to \mathbb{R}$ be a non-negative continuous function with $f(a)=f(b)=0$. I want to find a sequence $(f_n)_{n\in \mathbb{N}}$ which is at least $C^1([a,b])$, non-negative, $0$ in a neighborhood of $a$ and $b$ and converges to $f$ uniformly. There may be several ways to show this. My idea was to define the sequence in terms of $f$ by a cutoff: Let $f_n$ be $0$ in $\left[a,a+\frac{1}{n}\right)$ and $\left(b-\frac{1}{n},b\right]$. In the intervals $\left[a+\frac{1}{n},a+\frac{2}{n}\right)$ and $\left(b-\frac{2}{n},b-\frac{1}{n}\right]$ we want the function to be linearly growing from $0$ to $f\left(a+\frac{2}{n}\right)$ and linearly falling from $f\left(b-\frac{2}{n}\right)$ to $0$. In $\left(a+\frac{2}{n},b-\frac{2}{n}\right)$ let $f_n(x)=f(x)$. Then we use the standard mollifier in order to get a smooth function which now has compact support and we only have to show the convergence. I'm not quite sure if there will be any problems as the distance to the boundary is decreasing. However even if this might be true there has to be a more elegant way. I'm aware that we can find a sequence of differentiable functions which converges uniformly to a continuous function. Then the boundary conditions have to be argued.
I would be grateful for some help.

1

There are 1 best solutions below

5
On BEST ANSWER

Hints: There exists a polynomial $p$ such that $|\sqrt f(x)-p(x)| <\epsilon$ for all $x$. Let $q(x)=p(x)+cx+d$ where $c$ and $d$ are chosen such that $q(a)=q(b)=0$. Use the fact that $|p(a)| <\epsilon$ and $|p(b)| <\epsilon$ to show that $|\sqrt f -q|$ is uniformly small.Now show that $|f-q^{2}| $ is uniformly small. Let $g_n$ be a smooth function which vanishes in a neighborhood of $a$ as well as in some neighborhood of $b$, takes values in $[0,1]$ and has the value $1$ on $[\frac 1n , 1-\frac 1 n]$. Now you can see that $|f(x)-q^{2}(x)g_n(x)|$ is uniformly small.