TITLE: How find the example such $\left(\sup_{x\in R}|f'(x)|\right)^2=2\sup_{x\in R}|f(x)|\cdot\sup_{x\in R}|f''(x)|$
QUESTION [7 upvotes]: Question:

Find a example function $f$,such $f\in C^2(R)$,and such $$\left(\sup_{x\in R}|f'(x)|\right)^2=2\sup_{x\in R}|f(x)|\cdot\sup_{x\in R}|f''(x)|$$

This problem is from when I prove this inequality
$$\left(\sup_{x\in R}|f'(x)|\right)^2\le 2\sup_{x\in R}|f(x)|\cdot\sup_{x\in R}|f''(x)|$$
poof:
this inequality I have$$f(x+y)=f(x)+f'(x)y+f''(\xi)\dfrac{y^2}{2}$$
$$f(x-y)=f(x)-f'(x)y+f''(\eta)\dfrac{y^2}{2}$$
then 
$$f(x+y)-f(x-y)=2f'(x)y+\left(f''(\xi)-f''(\eta)\right)\dfrac{y^2}{2}$$
then 
$$2y|f'(x)|=|f(x+y)-f(x-y)-(f''(\xi)-f''(\eta))\dfrac{y^2}{2}|\le 2a+by^2$$
so 
$$\sup_{x\in R}|f'(x)|\le\dfrac{a}{y}+\dfrac{by}{2}$$
By Done 
But this problem ask the constant $2$ is best.so I think we must find a example,I can't find the function such $f\in C^2(R)$

REPLY [12 votes]: For an integer $n\geq3$ we consider $f_n(x)$ defined as follows:
$$f_n(x)=\left\{\matrix{\frac{1}{2n}-
    \frac{1}{2}  &\hbox{if}&  x <-1\cr
\frac{n}{6}(x+1)^3-\frac{1}{2}+\frac{1}{2n}&\hbox{if}&-1< x <\frac{1}{n}-1 \cr
\frac{x^2}{2}+\left(1-\frac{1}{2n}\right)x+\frac{1}{6n^2} &\hbox{if}& \frac{1}{n}-1< x <-\frac{1}{n}\cr
-\frac{n   x^3}{6}-\frac{x}{n}+x &\hbox{if}& -\frac{1}{n}<x<\frac{1}{n}\cr
-\frac{x^2}{2}+\left(1-\frac{1}{2n}\right)x-\frac{1}{6n^2}  &\hbox{if}&\frac{1}{n}<x
   <1-\frac{1}{n} \cr
\frac{n}{6}(x-1)^3+\frac{1}{2}-\frac{1}{2n}&\hbox{if}& 1-\frac{1}{n}<x<1\cr
 \frac{1}{2}-\frac{1}{2n}&\hbox{if}& x>1\cr
}\right.
$$
the functions $f_n$, $f'_n$ and $f''_n$ are depicted in the next figure:
$\hspace{2cm}$
It is straightforward to check that
$$\eqalign{\sup_{x\in\mathbb{R}}|f_n(x)|&=\frac{1}{2}-\frac{1}{2n}\cr
\sup_{x\in\mathbb{R}}|f'_n(x)|&=f'_n(0)=1-\frac{1}{n}\cr
\sup_{x\in\mathbb{R}}|f''_n(x)|&=1
}$$
So if $c$ is a constant that satisfies
$$\left(\sup_{\mathbb{R}}|f'|\right)^2\leq c\sup_{\mathbb{R}}|f|\cdot \sup_{\mathbb{R}}|f''|$$
for every bounded function $f:\mathbb{R}\to\mathbb{R}$ having bounded second derivative, then, applying this to $f_n$ we see that
$$\left(1-\frac{1}{n}\right)^2\leq c\left(\frac{1}{2}-\frac{1}{2n}\right)$$ 
Letting $n$ tend to $+\infty$ we get $c\geq 2$.
And we know that $c=2$ works, so $2$ is the best constant.
Remark 1. The sequence of functions $(f_n)_n$ does converge to a function that has a continuous derivative, but not a continuous second derivative.
Remark 2. Proving that $c=2$ is the best constant does not necessarily mean the we have to find an example that realizes the equality.