Finding the maximum of a function with two variables

10,460

Solution 1

Look for the critical points of $f(x,y)=20x-x^2+30y-y^2+xy$:

\begin{align} f_x(x,y)&=20-2x+y&f_y(x,y)&=30-2y+x \end{align}

The critical points $(x,y)$ of $f$ occurs when \begin{align} 20-2x+y&=0\\ 30-2y+x&=0\\ \end{align} So \begin{align} 2x-y&=20\\ x-2y&=-30\\ \end{align} Then $$x=\frac{70}{3}\quad\text{ and }\quad y=\frac{80}{3}$$

Next, evaluate the discriminant of $f$ at $(70/3,80/3)$: $$\Delta =f_{xx}(x,y)f_{yy}(x,y)-f_{xy}(x,y)^2$$ If $\Delta >0$ then in the critical point the function reaches a minimum. If $\Delta <0$ then in the critical point the function reaches a maximum.

In order to be sure that the critical point is not a saddle point verify $f_{xx}(x,y)$ and $f_{yy}(x,y)$ do not vanish at $(70/3,80/3)$.

Solution 2

Without Using Derivatives.

Let $$f(x,y)=-x^2-y^2+xy+20x+30y\;,$$ Now Put $x=u+v\;,y=u-v$

So $$f(u,v) = -(u+v)^2-(u-v)^2+(u+v)\cdot (u-v)+20(u+v)+30(u-v).$$

So $$\displaystyle f(u,v) = -u^2-3v^2+50u-10v$$

$$\displaystyle f(u,v) = -\left[u^2-50u+(25)^2-(25)^2\right]-3\left[v^2+\frac{10v}{3}+\frac{25}{9}-\frac{25}{9}\right]$$

So $$\displaystyle f(u,v) = -(u-25)^2-3\left(v+\frac{5}{3}\right)^2+625+\frac{25}{3}\leq 625+\frac{25}{3}$$

and equality hold when $$\displaystyle(u-25)=0\Rightarrow u=25$$ and $$\displaystyle \left(v+\frac{5}{3}\right)=0\Rightarrow v=-\frac{5}{3}$$

So $\displaystyle x=u+v=25-\frac{5}{3}=\frac{70}{3}$ and $\displaystyle x=u+v=25+\frac{5}{3}=\frac{80}{3}$

Share:
10,460

Related videos on Youtube

Lily
Author by

Lily

Updated on January 20, 2020

Comments

  • Lily
    Lily almost 4 years

    I started with $f(x,y)=20x-x^2+30y-y^2+xy$. I need to find the maximum values for both $x$ and $y$.

    I have differentiated it using implicit differentiation and have gotten to an answer of: $$y'=\frac{2x-20-y}{30-2y+x}.$$

    I know that I need to set this equation equal to zero, but I don't know how to get to numerical values for $x$ and $y$. Any help would be appreciated!

    • joriki
      joriki about 8 years
      You describe $f$ as a function of two variables, but the notation $f(x)$ only reflects one of them -- is that a typo?
    • Lily
      Lily about 8 years
      yes sorry that was a typo
    • joriki
      joriki about 8 years
      There's an edit button under the question. The idea is to fix the question so people don't have to read through the comments to understand it.
  • Lily
    Lily about 8 years
    Thank you very much!! is there any way to do it with implicit differentiation, or is this the only way to solve it?
  • Ángel Mario Gallegos
    Ángel Mario Gallegos about 8 years
    Here, $x$ and $y$ are independient variables, so none of them is treated as a function of the other, and implicit differentiation does not make sense, unless you set $f(x,y)=c$ for some constant $c$.