Finding the Minimum and Maximum of a Function of Two Variables Using Level Curves

The level curve method is a graphical technique used to identify the maximum or minimum of a function $f(x, y)$ over a set $A$, meaning within its domain.

It is an intuitive and visual approach, especially effective for simple functions and bounded domains (such as polygons).

What are level curves?

Level curves are the contours in the $(x, y)$ plane along which the function $f(x, y)$ remains constant:
$f(x, y) = \lambda$

In other words, each level curve consists of all the points in the plane where the function equals the same value $\lambda$.

How does the method work?

The method is straightforward and relies on geometric reasoning:

  1. Draw the domain $A$
  2. Plot the set $A$ in the $(x,y)$ plane. This defines the region where you will search for the function’s maximum and minimum.
  3. Plot the level curves of $f(x, y)$
  4. Draw several curves $f(x, y) = \lambda$ for different values of $\lambda$. Each curve shows where the function equals $\lambda$.
  5. Identify the maximum and minimum

The maximum corresponds to the highest level curve (i.e. the largest $\lambda$) that intersects or touches $A$.

The minimum corresponds to the lowest level curve (i.e. the smallest $\lambda$) that touches $A$.

When is this method useful? This method works very well for simple or symmetric functions (such as those involving squares, circles, or ellipses) and for polygonal or bounded domains. In other words, in situations where it is possible to visually understand how the function behaves. For more complex functions or irregular domains, this approach still offers valuable qualitative insights before moving on to more rigorous analytical methods.

    Example

    Let’s consider the following function:

    $f(x, y) = x^2 + y^2$

    and the domain $A$, defined as the square $-1 \leq x \leq 1$, $-1 \leq y \leq 1$.

    First, we plot the square $A$ in the $(x, y)$ plane.

    the domain of the function

    The level curves of this function are circles of radius $\sqrt{\lambda}$ centered at the origin.

    $$ x^{2}+y^{2}=\lambda,\qquad \lambda\ge 0. $$

    Solving for $y$, we obtain:

    $$ y^{2}=\lambda-x^{2}\quad\Longrightarrow\quad y=\pm\sqrt{\lambda-x^{2}} $$ 

    In order for a level curve to intersect the domain $A$, the corresponding value of $\lambda$ must be large enough for the circle to reach or touch $A$.

    Next, we plot the level curves by varying $ \lambda $.

    Since $ \lambda \ge 0 $, only non-negative values are admissible.

    example of level curves

    The smallest level curve that intersects $A$ is the degenerate circle of radius 0, corresponding to the single point $(0,0)$, where $f(0,0) = 0$.

    Therefore, the absolute minimum of the function over this domain is $0$, attained at the point $ (x,y)=(0,0) $.

    The largest level curve that still touches the domain is the circle passing through the vertices of the square.

    $$f(1,1) = 1^2 + 1^2 = 2$$

    Thus, the absolute maximum of the function over the domain is $2$, attained at the points $(1,1)$, $(-1,1)$, $ (1,-1) $, and $ (-1,-1) $.

    With a simple sketch, we have identified both the minimum and maximum values of the function.

    example of level curve analysis

    And so on.

     
     

    Please feel free to point out any errors or typos, or share suggestions to improve these notes. English isn't my first language, so if you notice any mistakes, let me know, and I'll be sure to fix them.

    FacebookTwitterLinkedinLinkedin
    knowledge base

    Functions with Two or More Variables