<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] 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).
</s>