Maximizing $\frac{y+1}{x+2}$ when $(x-3)^2 + (y-3)^2 = 6$ Suppose $x$ and $y$ are real numbers such that $(x-3)^2 + (y-3)^2 = 6.$ Than, maximize $\frac{y+1}{x+2}.$

I do in fact realize that this is a double post, but it's a 5 year old question and I don't feel as if it is appropriate to bump it. I did as the original post hinted towards, setting $k = \frac{y+1}{x+2}$ and than writing the given equation as $$(x-3)^2 + (k(x+2) - 4)^2 = 6.$$ I than proceeded to expand and simplify, which gave me $$x^2(k^2 + 1) + x(4k^2 - 8k - 6) + (4k^2 - 16k + 19).$$ However, I am unsure where to go from here. Should I use the discriminant now?
 A: Hint: Alternatively we can utilise trigonometry
WLOG $x-3=\sqrt6\cos2t,y-3=\sqrt6\sin2t$
We need to maximize $$F=\dfrac{\sqrt6\sin2t +4}{\sqrt6\cos2t+5}$$
Now use https://en.m.wikipedia.org/wiki/Weierstrass_substitution#The_substitution to form a quadratic equation in $\tan t$
As $\tan t$ is real, the discriminant must be $\ge0$
A: Going from what you have  (and avoiding calculus):
$(k^2 + 1)x^2 + (4k^2 -4k-3)x + (k^2 - 16k + 19)= 0$
If we plug this into the quadratic formula:
$x = \frac {-b \pm \sqrt {b^2 - 4ac}}{2a}$
When $b^2 - 4ac < 0$ the formula breaks.
Setting $b^2 - 4ac = 0$ will give us the extreme values of $k.$
$(4k^2 - 8k - 6)^2 - 4(k^2+1)(4k^2 - 16k + 19) \ge 0\\
(16k^4 - 64k^3 + (-48+64)k^2 + 96k + 36) - (16k^4-64k^3 + 4(19+4)k^2 -64k + 76)\ge 0\\
-76k^2 + 160k - 40 \ge 0\\
19k^2 - 40k + 10 \le 0\\
$
And now use the quadratic formula again to find the range of $k.$
$\frac {20 - \sqrt {210}}{19}\le k \le \frac {20 + \sqrt {210}}{19}
$
A: The function and the constraint are
$$
f(x,y) = \frac{y+1}{x+2}\\
\quad g(x,y) = (x-3)^2 + (y-3)^2 - 6 = 0
$$
using Lagrange multipliers
$$
\nabla f = (-\frac{y+1}{(x+2)^2}, \frac{1}{x+2}), \quad \nabla g = (2x,2y)
$$
We get the equations
$$
\nabla f - \lambda \nabla g = 0\\
g(x,y) = 0
$$
in $\lambda, x$, and $y$. The first (vector) equation is the two equations
$$
-\frac{y+1}{(x+2)^2} - \lambda 2x = 0  \tag{1} 
$$
$$
\frac{1}{x+2} - \lambda 2y = 0 \tag{2}
$$
Mathematica gives me the solution set
$$
x = \frac{1}{41}(93-4\sqrt{210}),\quad y = \frac{1}{41}(99+5\sqrt{210}),\quad \lambda = \frac{8400+971\sqrt{210}}{151620} \\
x = \frac{1}{41}(93+4\sqrt{210}),\quad y = \frac{1}{41}(99-5\sqrt{210}),\quad \lambda = \frac{8400-971\sqrt{210}}{151620} \\
$$
A: A bit of geometry.
Introduce new coordinates X,Y:
$Y := y+1;$ $X := x+2;$
1)$Y=CX;$
2)$(X-5)^2 + (Y-4)^2=6;$
Need to find the slope $C$ of the line $Y=CX$ s.t. it is tangent to the circle 2).
3)Distance of  tangent line $Y=CX$ to the centre of circle $(5,4):$
$\dfrac{|-5C+4|}{\sqrt{1+C^2}}=√6;$
$(-5C+4)^2=6(1+C^2);$
A quadratic equation for $C$. Choose the larger solution.
