Problem related to quadratic equation If $x$ is a real number then what is the greatest value of
  $$ f(x)=2(a-x)\left(x+\sqrt{x^2+b^2}\right)\;\;? $$ 
I cannot figure out how to convert this into a quadratic equation to find out the greatest value of $f(x).$
From what I've read, the answer is given by $a^2+b^2$.
 A: Let $M$ be the largest value of $f$. Then equation $f(x)=M$ has exactly one solution in $x$. This equation is equivalent to:
$$ M-2x(a-x)= 2(a-x)\sqrt{x^2+b^2}$$ after squaring and rearranging and canceling we get:
$$ M^2-2M(ax-x^2)= 4(a-x)^2b^2$$
If $M\ne 2b^2$ then this is quadratic equation in $x$ has discriminant $0$ so...
A: If you know some calculus it's probably easiiest to expand the whole equation (writing $\sqrt{x^2+b^2}$ as $(x^2+b^2)^{1/2}$ might help too, as it's easier to then implement the rules of differentiation). 
\begin{align*}
f(x)&=2(a-x)(x+\sqrt{x^2+b^2})\\
&=2ax+2a(x^2+b^2)^{1/2}-x^2-x(x^2+b^2)^{1/2}\\
\end{align*}
Now find the first derivative $f'(x)$ and set this to zero to find your critical point (or turning point) $x_0$.
Once you have solved $f'(x)=0$, you will need to differentite one more time to get $f''(x)$ and investigate its turning point. To summarise
First Derivative Test
Assume that $f'(x_0) = 0$.
Case $\{+,-\}$ If $f'$ is positive to the left of $x_0$, and negative to the right of $x_0$, then $f$ has a relative maximum at $x_0$.
Case $\{-,+\}$ If $f'$ is negative to the left of $x_0$, and positive to the right of $x_0$, then $f$ has a relative minimum at $x_0$.
Case $\{+,+\}$ and $\{-,-\}$ If $f'$ has the same sign in open intervals around $x_0$, then $f$ has neither a relative minimum or maximum at $x_0$.
Second Derivative Test for Relative Extrema
Assume that $f'(x_0) = 0$ and that $f''(x_0)$ exists. Then:
(i) if $f''(x_0)<0$, then $f$ has a relative maximum at $x_0$;
(ii) if $f''(x_0)>0$, then $f$ has a relative minimum at $x_0$;
(iii) if $f''(x_0)=0$, then $x_0$ can be either a relative maximum, a relative minimum, or a saddle point.
A: The extremum points of $f$ satisfy $f'(x)=0$. The maximum ones have $f$ increasing on the left and decreasing on the right.
Can you proceed further?
A: $$f(x)=2(a-x)\left(x+\sqrt{x^2+b^2}\right)$$
$$f'(x)=2 (a-x) \left(1+\frac{x}{\sqrt{x^2+b^2}}\right)-2 \left(x+\sqrt{x^2+b^2}\right)$$ 
$$f'(x)=2(a-x)\frac{x+\sqrt{x^2+b^2}}{\sqrt{x^2+b^2}}-2 \left(x+\sqrt{x^2+b^2}\right)$$
$$f'(x)=2\left(x+\sqrt{x^2+b^2}\right) \left(\frac{a-x}{\sqrt{x^2+b^2}}-1 \right)$$ So, you need to solve
$$\frac{a-x}{\sqrt{x^2+b^2}}=1\implies \frac{(a-x)^2}{x^2+b^2}=1$$ which makes your quadratic equation which, in fact, is linear
$$\frac{(a-x)^2}{x^2+b^2}=1 \implies (a^2-b^2)-2 a x=0$$ I am sure that you can take it from here.
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$
