# How find this maximum $f(x)=\sqrt{\frac{1+x^2}{2}}+\sqrt{x}-x$

let $x\ge 0$,Find the follow maximum $$f(x)=\sqrt{\dfrac{1+x^2}{2}}+\sqrt{x}-x$$

I find $$f'(x)=\dfrac{1}{2}\left(\dfrac{\sqrt{2}x}{\sqrt{x^2+1}}+\dfrac{1}{\sqrt{x}}-2\right)$$ so $$f'(x)=0\Longrightarrow x=1$$ so I think $$f(x)_{max}=f(1)$$

But I this methods is ugly, and I think this have AM-GM inequality or Cauchy-Schwarz inequality to solve this problem $$f(x)=\sqrt{\dfrac{1+x^2}{2}}+\sqrt{x}-x\le\sqrt{\dfrac{1+x^2}{2}}+\dfrac{1}{2}(1+x)-x=\sqrt{\dfrac{1+x^2}{2}}+\dfrac{1}{2}(1-x)$$

Then I can't,Thank you

• What do you mean with "But I can't prove it"? Feb 15, 2014 at 13:54
• Do you know for a fact that "$f'(x)=0\Longrightarrow x=1$"? The reverse implication is clear, but this one?
– Did
Feb 15, 2014 at 14:05

Simply consider that $\sqrt{x}$ is a concave function, hence, for any $a,b\geq 0$, $\sqrt{a}+\sqrt{b}\leq \sqrt{2(a+b)}$. By taking $a=x$ and $b=\frac{1+x^2}{2}$ you get $f(x)\leq 1$ with equality only when $x=\frac{1+x^2}{2}$, i.e. $x=1$, as wanted.

• Quite nice. +1.
– Did
Feb 15, 2014 at 15:36

Let us show that $f(x)+x\leqslant x+1$ for every $x$. This holds true if and only if $$\sqrt{\frac{x+\frac1x}2}+1\leqslant\sqrt{x}+\frac1{\sqrt{x}}.$$ Let $u=\sqrt{x}+\frac1{\sqrt{x}}$, then $u\geqslant2$ for every $x\geqslant0$ and $x+\frac1x=u^2-2$ hence it is enough to show that $g(u)\leqslant0$ for every $u\geqslant2$, where $$g(u)=\sqrt{\frac{u^2-2}2}+1-u.$$ Now, $g(2)=0$ and $$g'(u)=\frac{u-\sqrt{2u^2-4}}{\sqrt{2u^2-4}}=\frac{4-u^2}{(u+\sqrt{2u^2-4})\sqrt{2u^2-4}}\leqslant0,$$ hence $g(u)\leqslant0$ for every $u\geqslant2$. Finally, $f(x)\leqslant1$ for every $x$ and $f(1)=1$ hence $f(x)$ is maximum at $x=1$, and only there.

If I may, I should be cautious with this function.

As you showed, and this is correct, the first derivative cancels at $x=1$. But, the second and third derivatives also cancels at the same point. Only the fourth derivative is not zero for $x=1$; it is equal to $-\frac{3}{8}$ and, since negative, $x=1$ corresponds to a maximum (http://en.wikipedia.org/wiki/Higher-order_derivative_test).

Built around $x=1$, the Taylor expansion is
$$1-\frac{1}{64} (x-1)^4+\frac{3}{128} (x-1)^5+O\left((x-1)^6\right)$$

If you plot your function, you will notice that it is extremely flat around $x=1$. For example, $f(0.7)=0.999794$, $f(0.8)=0.999966$, $f(0.9)=0.999998$, $f(1.1)=0.999999$, $f(1.2)=0.999981$, $f(1.3)=0.999917$.

In practice, having a maximum value of $1$ for $x=1$, the function value is greater then $0.99$ for any value of $x$ in the range $[0.341 , 2.299]$.

You've done just fine.

You can certainly confirm/prove that $f(1)$ is a maximum by any number of methods, one of which is to pick two values of $x$, say $x_1$, $x_2$ such that $x_1 < 1< x_2$, and show that $f'(x_1) >0$, and $f'(x_2) < 0$.

Alternatively, you can find $f''(x)$ and show that $f''(1)< 0$. (EDIT: As indicated in the comments, here, in fact, you need to go as far as the fourth derivative to confirm that $f(1)$ is a maximum.)

Either of these approaches establish that $f(1)$ is a local maximum.

• Local maximum.
– Did
Feb 15, 2014 at 14:28
• But $f''(1) = 0$. Feb 15, 2014 at 15:16
• Here, you need to continue to the fourth derivative (since $f'''(1) = 0,$ too). $$f''''(1)<0$$ hence $f(1)$ is a local maximum. Feb 15, 2014 at 15:20

Find f''(x)

if f''(x_0) is -ve than x_0 is point of maximum

else f''(x_0) is +ve than x_0 is point of minimum