<s>[INST] 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.
 [/INST] 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$$
</s>