I have the following problem.
Find the maximum and minimum of the following function:
$$x^2 + y^2 - 4x - 2y +4$$
within the range $$x^2 + y^2 ≤ 16$$
I have ofcourse attempted this question myself. I have managed to find the minimum value. I did this by taking the derivative of the function two times, once with respect to x and once with respect to y. This gave me the point (2,1) and after substituting it back in the function gave the minimum value of -1.
Now i am trying to calculate the maximum value of the maximum value of the function which i think we can find by looking at the boundary values, x^2 + y^2 ≤ 16.
I have tried two things and still get the incorrect answer.
Attempt 1:
Substituting $$x = 4cost$$, $$y = 4sint$$.
$$16cos^2(t) + 16sin^2(t) - 4*4cost(t) - 2*4sin(t) + 4$$
$$16(cos^2(t) + sin^2(t)) - 16cos(t) - 8 sin(t) + 4$$
$$16 - 16cos(t) - 8sin(t) + 4$$
$$20 - 16cos(t) - 8sin(t)$$
By looking at the last line here, we can see that the maximum is when t = pi. This will cos(t) = -1 and sin(t) = 0
20 - 16cos(t) - 8sin(t) = 20 + 16 - 0 = 36. However 36 is incorrect and i dont understand why.
Attempt 2:
$$x^2 + y^2 ≤ 16$$
$$x^2 + y^2 = 16$$
$$y = sqrt(16-x^2)$$
Substituting this into the original equation gives:
$$x^2 + (16-x^2) - 4x - 2sqrt(16-x^2) +4$$
$$20 - 2sqrt(16-x^2) - 4x$$
By looking at this equation we can see that the maximum value is when 2sqrt(16-x^2) is 0. This happens when x = 4.
$$20 - 2sqrt(16-(4)^2) -4(4)$$
$$20 - 0 - 16 = 4$$
4 is also incorrect.
Can anyone help me with this question. I would also like to understand why I cant solve the question in the way i have attempted.
Thank you for your time. Please tell me if something was unclear.
Note that your $f(x,y)$ is equal to $$f(x,y)=(x-2)^2+(y-1)^2-1$$ and from here we get $$f_{min}=-1$$ for $y=2,x=1$