I need to find the max of $$f(x)=\sqrt{(x^2-4)^2+(x-5)^2}-\sqrt{(x^2-2)^2+(x-1)^2}$$
When $x$ is a real number.
What i did is to simplify: $$f(x)=\sqrt{x^4-7x^2-10x+41}-\sqrt{x^4-3x^2-2x+5}$$.
Then i compute: $$f'(x)=\frac{-5-7x+2x^3}{\sqrt{41-10 x-7 x^2+x^4}}+\frac{1+3x-2x^3}{\sqrt{5-2 x-3 x^2+x^4}}$$.
But failed to solve $f'(x)=0$ for finding $f(x)_{max}$.
I would be glad for your help.
Thanks.

here is geo solution which might be make things clear:
let $y=x^2,A(x,y),B(5,4),C(1,2)$,your problem become when $A$ moves on $y=x^2$, find max of $AB-AC$.
it is trivial $AB-AC <CB$, except when $A=D$ then $DB-DC=CB$