
The above is the graph of

I used Winplot to plot the two functions and find their extreme values. You could also use calculus to do the same , and if requested, I would be happy to show my work.
But where does the equation come from? The equation given is the equation of a circle that has the standard form

I solved this equation for y to get

and then subtracted the expression for y from x to get f(x). By the way, the exact values of the coordinates of the extreme point displayed in the plot are

So the maximum value of x-y is \(\frac{\sqrt{33}}{2}\) or approximately 2.87228.