# $\exists f\in C^1$ such that $f(0)=0,\;f(x)>0\;\forall x>0$, but $f'\leq0$ for points near zero?

The question is about the existence of a function $f:[0,+\infty),$ with $f\in C^1\left([0,+\infty)\right)$ such that

$$f(0)=0,\quad f(x)>0,\;\forall x>0,$$

and there is a strictly decreasing sequence $\{x_n\}_{n\in\mathbb{N}}\subset[0,1)$ with $\lim\limits_{n\rightarrow\infty}x_n=0$ such that

$$f'(x_n)\leq0,\;\forall n\in\mathbb{N}.$$

The exercise was about proving that such $f$ doesn't exist... but I failed in all my attempts.

Thanks in advance for any help!

• Intuitively, if you choose a $x_n$ that is arbitrarily close to zero, and the slope there is negative, the function is dropping there. With $f(0)=0$, we can see the function starts from zero and is dropping. However, this is forbidden by $f(x)>0$. Thus, such function does not exist. Jun 20 '18 at 14:37
• $f(x) = x^2$ fulfills all your criterias…
– Gono
Jun 20 '18 at 14:38
• @Gono The derivative has to be negative near zero. Jun 20 '18 at 14:39
• @Szeto No, the derivative has to be non-negative. And $f'(0) = 0 \le 0$
– Gono
Jun 20 '18 at 14:40
• @Gono What $\{x_n\}$ would be suitable? Jun 20 '18 at 14:40

Such function does exist. Consider $$f(x):=x^3(2+\sin(1/x))$$ extended by continuity at $x=0$ (see a plot at WA).

We have that $f\in C^1\left([0,+\infty)\right)$, $f(0)=0$, and $f(x)>0$ for $x>0$. Moreover, there is a strictly decreasing positive sequence $\{x_n\}_n$ such that $x_n\to 0^+$ and $f'(x_n)<0$.

Set $$f(x)=x^{5/2}\left(2+\sin\Big(\frac1x\Big)\right)$$ Then

a. $f(0)=0$ and $f(x)>0$, for all $x>0$.

b. $f'(x)=\frac{5}{2}x^{3/2}\left(2+\sin\Big(\frac1x\Big)\right)-x^{1/2}\cos\Big(\frac1x\Big)$, so for $x_n=\frac{1}{2n\pi}\to 0^+$ we have $$f'(x_n)=\frac{5}{2}(2\pi n)^{-3/2}\big(2+\sin(2n\pi)\big)-(2n\pi)^{-1/2}\cos(2n\pi)=5(2\pi n)^{-3/2}-(2\pi n)^{-1/2} \\ = (2\pi n)^{-1/2}\left(\frac{5}{2\pi n}-1\right).$$ Observe that $$f'(x_n)<0$$ for all $n\in\mathbb N$.

• But the derivative it is not continuous in zero... Jun 20 '18 at 15:02
• @Yiorgos S. Smyrlis Your function is NOT $C^1\left([0,+\infty)\right)$. This is the reason why I put a $x^3$. Jun 20 '18 at 15:02
• @Fernando: I have modified $f$ to be $C^1$ in $[0,\infty)$. Jun 20 '18 at 15:14

Here's a $C^\infty$ example with this property:

$$f(x) = e^{-1/x}(2+ \sin(1/x^2)),\,\, x> 0,$$

$f(0)=0.$ Here you can check $f'(1/\sqrt {2n\pi})<0$ for $n=1,2,\dots$

However, there is no real analytic example with this property.

You can find non-trivial counter-examples for this. For every $$n$$, let $$f_n:[1/(2n),1/(2n-1)]\to\mathbb{R}$$ be a function that satisfies:

• $$supp(f_n)\subseteq (1/(2n),1/(2n-1))$$;
• $$f_n'(x)<-2$$ for some $$x$$;
• $$\max_x |f_n(x)|<1/(2n)$$

You can construct these functions by playing around with mollifiers and something like $$e^{-1/(x^2)}$$. You can see mollifiers here: https://en.wikipedia.org/wiki/Mollifier

The general idea is that it looks like this.

Now patch up all these functions: Let $$g$$ be equal to $$f_n$$ on each interval $$[1/(2n),1/(2n-1)]$$, and 0 everywhere else. The function $$f(x)=g(x)+x$$ has the properties you want and $$f'(x_n)<-1$$ for a sequence of point $$x_n\in[1/(2n),1/(2n-1)]$$

EDIT: This can be seen as a soft version of Robert Z's answer

Hint: Take $f(x) = x^2, x_n \equiv 0$ and you are done.

edit: This answer was for a former version of this question. Now it's wrong obviously

• Yes, sorry for that, but I was looking for the other answers Sep 19 '18 at 6:49