Given $S =\{ x-y \mid (x,y) \in \Bbb R , x^2+y^2=1\}$, find $\max S$ My solution:
$x^2+y^2=1$ is the equation of a circle.
Let $x-y=k$. That becomes the equation of a line. Since $(x-y) \in S$,
the point $(x,y)$ satisfies both the circle and the line equation. So we know that the graph of the circle and the line have at least $1$ intersection. Now here's the part I have a question about. I drew the graph of the circle and visualised the line equation (slope$=1$) and one can easily conclude that the maximum and minimum values of $k$ occur when the line is a tangent to the circle.
So after concluding this, rest is just calculation. ( The answer is $\sqrt2$, by the way).
My questions are:

*

*Can we prove that(without visualization) the maximum and minimum values of $k$ occur when the line is tangent to the circle?

2.Is there any other method to solve such a question?

Well,... let $y = \pm \sqrt {1-x^2}$ and let $d_1(x) = x-y= x-\sqrt{1-x^2}$ when $y\ge 0$ and $d_2(x) =x-y=  x+\sqrt{1-x^2}$ when $y < 0$.
Then $d_1'(x) = 1 -\frac 12\frac 1{\sqrt{1-x^2}}*(-2x)= 1+\frac x{\sqrt{1-x^2}}$
And $d_2'(x) = 1-\frac {x{\sqrt{1-x^2}}$.
Solving for $d_1'(x) = 0$ and $d_2'(x)=0$ we get:
$d_1'(x) = 1+\frac x{\sqrt{1-x^2}}=0$
$x = -\sqrt{1-x^2}$
$x^2 = 1-x^2; x\le 0$
$x = -\frac 1{\sqrt 2}$.
$d_1'(x) = 1-\frac x{\sqrt{1-x^2}}=0$
And $x=\sqrt{1-x^2}$
$x^2 = 1-x^2; x\ge 0$
$x = \frac 1{\sqrt 2}$. are the two critical points.
Could do second derivative test to determine if max/min but it's easier and practical to plug the values in.
At $x =-\frac 1{\sqrt 2};y \ge 0;x\le 0$ we have $x^2 + y^2 =1$ so $y=\frac 1{\sqrt 2}$ and $x-y = -\sqrt 2$.
And at $x = \frac 1{\sqrt 2}; y \le 0; x \ge 0$ we have $x^2 + y^2 =1$ so $y=-\frac 1{\sqrt 2}$ and $x-y = \sqrt 2$.
so $\sqrt 2$ is the max $x-y$ can be and $-\sqrt 2$ is the min.
