Function with 2 variables within a domain

46 Views Asked by At

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.

2

There are 2 best solutions below

7
On

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$

0
On

Don't leave geometric intuition by the wayside. After completing the squares to get $$f(x,y)=(x-2)^2+(y-1)^2-1$$ we see that the value of $f(x,y)$ is simply the squared distance from $(x,y)$ to $(2,1)$, minus one.

To find the maximum, we must therefore look for the point in your domain that is farthest from $(2,1)$. That's the one on the opposite end of the diameter through $(2,1)$, and its distance from $(2,1)$ is $$ 4 + \sqrt{2^2+1^2} $$ The square of this distance is $$ 16 + 5 + 8\sqrt5 $$ so the maximum function value is $$ 20 + 8\sqrt5 $$


In your attempt 1, you're wrong when you claim that the maximum of $20-16\cos t-8\sin t$ is at $t=\pi$. Consider that at that point the derivative of the cosine is $0$, so a small change in $t$ does not affect that term -- the derivative of the sine is $-1$, so a $t$ slightly larger than $\pi$ will lead to a higher value for the function. So we didn't have a maximum at $t=\pi$.

In your attempt 2, I don't get at all how you conclude that " the maximum value is when $2\sqrt{16-x^2}$ is $0$".