Maximum value of $f(x)=2(a-x)(x+\sqrt{x^2+b^2})$ If $a,b,x$ are real and $$f(x)=2(a-x)(x+\sqrt{x^2+b^2}),$$ then find the maximum value of $f(x)$.
Is there any method to solve this question without differentiation because using differentiation I am getting an ugly expression.
 A: This is still differentiation, but less ugly:
$$f(x)=2(a-x)(x+\sqrt{x^2+b^2})\implies\log f = \log 2+\log(a-x)+\log(x+\sqrt{x^2+b^2})$$
$$\implies\frac{f'(x)}{f(x)}=\frac{-1}{a-x}+\frac{1}{\sqrt{x^2+b^2}}$$
$$f'(x_*)=0\implies a-x_*=\sqrt{x_*^2+b^2}\implies(a-x_*)^2=x_*^2+b^2$$
$$\implies x_*=\frac{a^2-b^2}{2a}$$
So, $f(x)\le f(x_*)$
$$=2(a-x_*)(x_*+\sqrt{x_*^2+b^2})=2(a-x_*)(x_*+a-x_*)$$
$$=2a(a-x_*)=2a^2-2ax_*=a^2+b^2$$
A: Starting with $f(x)=2(a-x)(x+\sqrt{x^2+b^2})$, take $x=b\sinh\theta$:
$$f(x)=2(a-b\sinh\theta)(b\sinh\theta+b\cosh\theta)=2b(a-b\sinh\theta)\exp\theta$$
Now, let $\gamma=\exp\theta$:
$$f(x)=2b\gamma\left(a-b\frac{1}{2}\left(\gamma-\frac{1}{\gamma}\right)\right)=-b^2\left(\gamma^2-2\frac{a}{b}\gamma-1\right)$$
Now, complete the square:
$$f(x)=-b^2\left(\left(\gamma-\frac{a}{b}\right)^2-1-\frac{a^2}{b^2}\right)=(a^2+b^2)-(a-b\gamma)^2$$
The result is clear from here.
Post-mortem: One might now note that we could have looked at the expansion of $(a-x-\sqrt{x^2+b^2})^2$ and compare it to our $f$ to get straight to this inequality (though it is perhaps unreasonable to expect us to intuit it a priori).
A: let $\sqrt{x^2+b^2}+x=y,$ then $\displaystyle \sqrt{x^2+b^2}-x = \frac{b^2}{y}$ and $\displaystyle 2x=y+\frac{b^2}{y}$
$\displaystyle f(x) = (2a-2x)(x+\sqrt{b^2+y^2}) = (2a-y-\frac{b^2}{y})\cdot y = (2ay-y^2-b^2) $
$f(y)= (a^2+b^2)-(y-b)^2\leq (a^2+b^2)$ equality hold when $y=b$
A: you will need the first derivative and the solutions of the equation $$f'(x)=0$$
the first derivative is given by $$f'(x)=2\,{\frac {a\sqrt {{a}^{2}+{x}^{2}}-2\,x\sqrt {{a}^{2}+{x}^{2}}-{a}^{2
}+ax-2\,{x}^{2}}{\sqrt {{a}^{2}+{x}^{2}}}}
$$
setting $$f'(x)=0$$ we obtain
$$\sqrt{a^2+x^2}(a-2x)=2x^2-ax+a^2$$
squaring and simplifying we get $$x=0$$
i have made a typo, the first derivative is given by $$f'(x)=2\,{\frac {a\sqrt {{b}^{2}+{x}^{2}}-2\,x\sqrt {{b}^{2}+{x}^{2}}+ax-{b}
^{2}-2\,{x}^{2}}{\sqrt {{b}^{2}+{x}^{2}}}}
$$
solving this equation we get:$$x=1/2\,{\frac {{a}^{2}-{b}^{2}}{a}}$$
