Is there a continuous function f(x) that tends to zero for both positive and negative infinity and f(0) = c

136 Views Asked by At

Is there a continuous function f(x) that tends to 0 as x approaches both positive and negative infinity and f(0) = c, where c is some given constant?

4

There are 4 best solutions below

0
On BEST ANSWER

The function $ce^{-x^2}$ works.

1
On

What about this function?

$f(x)=-x+c, 0\le x \le 1$;

$f(x)=0, x>1$

$f(x)=x+c, -1\le x \le 0$;

$f(x)=0, x<-1$

1
On

Another answer for the sake of completeness : if you don't know what $e$ is or if you want a single expression for the whole $\mathbb{R}$, you may use $f : x \rightarrow \dfrac{c}{1+x^2}$.

0
On

Let $g(x)$ be any continuous function with $g(x)\to+\infty$ as $x\to\pm\infty$ (for example $g(x)=x^4+42x^3+\sin x$ or $g(x)=e^{x^2}$). Then $g$ has a global minimum, say $g(x)\ge a$ for all $x\in\mathbb R$. Then for any $b>-a$, the function $f(x)=\frac{c(g(0)+b)}{g(x)+b}$ is a solution to your problem. (For example, with $g(x)=e^{x^2}$, we have $a=1$ and with $b=0$ we obtain Peter's answer; with $g(x)=x^2$, we have $a=0$ and with $b=1$ we obtain Traklon's answer, ...)