Functions of Two Variables and Their Graphs

Graphing

We've been graphing curves in space using parametric equations, where xx, yy, and zz vary with respect to tt. Now we're going to switch gears a bit and look at graphs of functions like z=f(x,y),z=f(x,y),

where zz is a function of xx and yy. In other words, each combination of xx and yy corresponds to a value of zz. What will these graphs look like, in general? In two dimensions, we had y=f(x)y=f(x), which described a curve in the xyxy plane, as each value of xx corresponded to a value of yy. Now, in three dimensions, a function z=f(x,y)z=f(x,y) will trace out a surface in R3\mathbb{R}^3, where the height of the surface at any given point (x,y)(x,y) is zz.

For example, consider z=2x+y2x2.z=\dfrac{\sqrt{2x+y-2}}{x-2}.

The domain of this function depends on where the denominator is 00 and where the square root in the numerator is negative. Specifically, the domain is D={(x,y) : x2, y2x+2}.\ans{D = {(x,y)\ :\ x \neq 2,\ y \geq -2x+2}.}

The graph is shown below (note that Matlab goes a bit wacky at x=2x=2, the discontinuity.

Surface example

Ellipsoid

Graph the following equation. Note that it is not actually a function, since it isn't one-to-one. x29+y216+z225=1\dfrac{x^2}{9}+\dfrac{y^2}{16}+\dfrac{z^2}{25} = 1

Solution

One way to graph an equation like this is to use traces, which are curves in a plane parallel to one of the coordinate planes. For instance, if we let z=0z=0, we get a graph in the xyxy plane: x29+y216+0225=1x29+y216=1\dfrac{x^2}{9}+\dfrac{y^2}{16}+\dfrac{0^2}{25} = 1 \longrightarrow \dfrac{x^2}{9}+\dfrac{y^2}{16} = 1

This is an ellipse with major and minor axes of 44 and 33. For other values of zz, we graph ellipses in planes above or below z=0z=0, until z=±5z=±5, where the ellipse shrinks to a point.

The graph looks like the following (kind of like an M&M shape):

Ellipsoid

Paraboloid

Graph the following function. z=f(x,y)=x2+y2z=f(x,y)=x^2+y^2

Solution

Consider different values of zz again: zCurveDescription1x2+y2=1Impossible0x2+y2=0Point at the origin1x2+y2=1Circle of radius 1 centered at the origin2x2+y2=2Circle of radius 2 centered at the origin4x2+y2=4Circle of radius 4 centered at the origin9x2+y2=9Circle of radius 9 centered at the origin\begin{array}{l l l} z & \textrm{Curve} & \textrm{Description}\ \hline -1 & x^2+y^2=-1 & \textrm{Impossible}\ 0 & x^2+y^2=0 & \textrm{Point at the origin}\ 1 & x^2+y^2=1 & \textrm{Circle of radius 1 centered at the origin}\ 2 & x^2+y^2=2 & \textrm{Circle of radius 2 centered at the origin}\ 4 & x^2+y^2=4 & \textrm{Circle of radius 4 centered at the origin}\ 9 & x^2+y^2=9 & \textrm{Circle of radius 9 centered at the origin}\ \end{array}

We'll use Matlab to see the graph of this function:

>> fsurf(@(x,y) x.^2+y.^2)

Paraboloid

This is called a paraboloid, and as the name suggests, it looks like a parabola in both directions.

The domain of this function is D={(x,y) : <x<, <y<}D = {(x,y)\ :\ -\infty < x < \infty,\ -\infty < y < \infty} and the range is R={z : 0z<}.R = {z\ :\ 0 \leq z < \infty}.

Level Curves

We've already used level curves; when we held zz constant and described the resulting curve in a horizontal plane, we were finding paths where the elevation doesn't change. Think about a topographic map; it shows the level curves of terrain.

Topographic map

Describe the level curves of the following function. f(x,y)=yx21f(x,y) = y-x^2-1

Solution

If we hold the function constant (f(x,y)=z=z0f(x,y)=z=z_0), we get curves like yx21=z0y=x2+1+z0y-x^2-1=z_0 \longrightarrow y=x^2+1+z_0

Since 1+z01+z_0 is a constant, these are parabolas.

The graph of the function and a few of the level curves are shown below.

Surface

Level curves

Describe the level curves of the following function. f(x,y)=2+sin(xy)f(x,y) = 2+\sin (x-y)

Solution

Hold zz constant: 2+sin(xy)=z0y=xsin1(z02)2+\sin (x-y)=z_0 \longrightarrow y=x-\sin^{-1}(z_0-2)

Note that sin1(z02)\sin^{-1}(z_0-2) is a constant, so these are straight lines y=xky=x−k.

The graph of the function is shown below, and you should be able to see that the function stays constant along straight lines.

alt text

Applications

Electric Potential

The electric potential function for two positive charges, one at (0,1)(0,1) with twice the charge of one at (0,1)(0,1), is given by ϕ(x,y)=2x2+(y1)2+1x2+(y+1)2\phi (x,y) = \dfrac{2}{\sqrt{x^2+(y-1)^2}} + \dfrac{1}{\sqrt{x^2+(y+1)^2}}

First, we'll graph this function using Matlab:

>> fsurf(@(x,y) 2./sqrt(x.^2+(y-1).^2) + 1./sqrt(x.^2+(y+1).^2))

Electric potential graph

  1. For what values of xx and yy is ϕ\phi defined?
  2. Is the electric potential greater at (3,2)(3,2) or (2,3)(2,3)?
  3. Describe how the electric potential varies along the line y=xy=x

Solution

  1. Domain: where is the denominator in each term 00? x2+(y1)2=0(0,1)x2+(y+1)2=0(0,1)\begin{aligned} x^2+(y-1)^2 = 0 &\longrightarrow (0,1)\ x^2+(y+1)^2 = 0 &\longrightarrow (0,-1) \end{aligned}

Therefore, the domain is every point except for these two (the potential approaches infinity near these points). D={(x,y) : R2{(0,1)(0,1)}}\ans{D = {(x,y)\ :\ \mathbb{R}^2 \setminus {(0,1) \cup (0,-1)}}}

  1. Plug these two points into the function: ϕ(3,2)=29+1+19+90.868ϕ(2,3)=24+4+14+160.931\begin{aligned} \phi (3,2) &= \dfrac{2}{\sqrt{9+1}} + \dfrac{1}{\sqrt{9+9}} \approx 0.868\ \phi (2,3) &= \dfrac{2}{\sqrt{4+4}} + \dfrac{1}{\sqrt{4+16}} \approx 0.931 \end{aligned}

Therefore, the potential is greater at (2,3).\ans{(2,3).}

  1. Replace yy with xx: ϕ=2x2+(x1)2+1x2+(x+1)2=22x22x+1+12x2+2x+1\begin{aligned} \phi &= \dfrac{2}{\sqrt{x^2+(x-1)^2}} + \dfrac{1}{\sqrt{x^2+(x+1)^2}}\ &= \ans{\dfrac{2}{\sqrt{2x^2-2x+1}} + \dfrac{1}{\sqrt{2x^2+2x+1}}} \end{aligned}

Economics

The output QQ of an economic system subject to two inputs, such as labor LL and capital KK, can be modeled by the Cobb-Douglas production function Q(L,K)=cLaKbQ (L,K) = cL^aK^b

where aa, bb, and cc are positive real numbers.

Suppose a=13a=\dfrac{1}{3}, b=23b=\dfrac{2}{3}, and c=40c=40. We can graph this with Matlab:

>> fsurf(@(x,y) 40.*x.^(1/3).*y.^(2/3))

Economics example

If LL is held constant at 1010, find the dependence of QQ on KK.

Solution

Q=40(101/3)K2/3Q=40(10^{1/3})K^{2/3}

This is a trace along a vertical plane.

  1. Find the domain of f(x,y)=2xy3x+4yf(x,y) = 2xy-3x+4y.

  2. D={(x,y) : <x<, <y<}D = {(x,y)\ :\ -\infty < x < \infty,\ -\infty < y < \infty}

  3. Find the domain of f(x,y)=12y2x2f(x,y) = \dfrac{12}{y^2-x^2}.

  4. D={(x,y) : y±x}D = {(x,y)\ :\ y \neq \pm x}

  5. Find the domain of f(x,y)=25x2y2f(x,y) = \sqrt{25-x^2-y^2}.

  6. D={(x,y) : x2+y225}D = {(x,y)\ :\ x^2+y^2 \leq 25}

  7. Find the domain of f(x,y)=ln(x2y)f(x,y) = \ln(x^2-y).

  8. D={(x,y) : y<x2}D = {(x,y)\ :\ y < x^2}

  9. Describe the level curves of z=xy2z=x-y^2.

  10. These are horizontal parabolas x=y2+z0x=y^2+z_0.

  11. Describe the level curves of z=2xyz=2x-y.

  12. These are straight lines y=2xz0y=2x−z_0.

  13. Describe the level curves of z=3cos(2x+y)z=3\cos(2x+y).

  14. These are straight lines y=cos1(z03)2xy=\cos^{-1}\left(\dfrac{z_0}{3}\right)-2x