# Need desperate help with sketching functions/equations of functions of 2 and 3 variables

Can someone please give an explanation for the following questions I have just been stuck on this part forever:

1) How do we sketch a function of two variables i.e $f(x,y)=x^2+y^2$ and how do we sketch a function of three variables i.e $f(x,y,z)=x^2+y^2+z^2$. Is the same method used for both, if not what is the difference and what is the method used? Also I understand a function of two variables is a surface in $\mathbb{R}^3$ but for a function of three variables should that not be done in $\mathbb{R}^4$ which I understand is not possible to visualize so how exactly do we sketch a function of three variables in $\mathbb{R}^3$?

Also I'm not being able to differentiate between functions of two variables and functions of three variables e.g if we have $z=f(x,y)=x^2+y^2$ surely we can take the rhs to the lhs and get $z-x^2+y^2=0$ so is this not a function of three variables.

I also can't tell the difference between a function and an equation.E.g $z=x^2-y^2$ is a function but $z=x^2$ is an equation, how can we tell this? Are functions and equations sketched differently?

What is the difference between a level curve, a level surface and a level set?

First, the term level set is the generic term. level curve and level surface are special cases. When you have a function of 2 variables: $$z=f(x,y)$$, setting the output equal to a constant, say $$c$$, yields an equation: $$c=f(x,y)$$. All points $$(x,y)$$ which satisfy this equation form a graph (in the $$xy$$-plane). This collection of points is called a level curve.

Now if you have a function of 3 variables: $$w=f(x,y,z)$$, setting the output equal to a constant, say $$c$$, yields an equation: $$c=f(x,y,z)$$. All points $$(x,y,z)$$ which satisfy this equation form a graph (in 3-space). This collection of points is called a level surface.

Generically, level curves are in fact curves and level surfaces are in fact surfaces (there are weird cases where a level curve is empty or 1 point or the whole plane, but usually you get a curve - the same weirdness can happen for level surfaces).

Next, how do you graph $$z=x^2+y^2$$? To do this by hand, first identify what its level curves look like: $$c=x^2+y^2$$ (these are circles centered at the origin). Often it is helpful to find a few other "traces" as well (level curves come from intersecting with $$z=c$$. In general, a "trace" is an intersection with any plane). For example: $$x=0$$ yields $$z=y^2$$ (a parabola) and $$y=0$$ yields $$z=x^2$$. So horizontal cross sections are circles and vertical cross sections are parabolas. This is a circular paraboloid whose graph looks like this.

Finally, for $$f(x,y,z)=x^2+y^2+z^2$$, you are correct that a graph of $$w=x^2+y^2+z^2$$ would live in $$\mathbb{R}^4$$ (so we can't visualize it). If someone asks you to graph such a thing, they probably meant to say "graph a few of its the level surfaces". If this is what is meant, then the level surfaces have equations of the form $$c=x^2+y^2+z^2$$. These are spheres of radius $$\sqrt{c}$$ centered at the origin (assuming, of course, that $$c>0$$). When $$c=0$$, we just get the origin and if $$c<0$$, the level surface is empty.

• Thank you so much for your explanation. Another question, apart from the level surface, can we also sketch traces for the graph of f(x,y,z)? – user134785 Apr 7 '14 at 14:41
• Sure. But you'll need to cut through with a "hyper-plane" instead of a plane -- that is -- something whose general formula is $ax+by+cz+dw=0$ for some constants $a,b,c,d$ (not all zero). So for example you could take the trace through $x=0$. This would yield the equation: $w=0^2+y^2+z^2=y^2+z^2$ which is a paraboloid. :) – Bill Cook Apr 7 '14 at 16:12
• I know this is a dumb question but I still want to ask just to be sure, if I'm asked to sketch e.g z=x^2+y^2 and x^2+y^2-z=0, the first one which is a function as well as an equation and the second one which is just an equation, I will get the same graph right? – user134785 Apr 7 '14 at 16:54
• Yes. The two equations are equivalent so they yield the same graph. – Bill Cook Apr 8 '14 at 1:31

To sketch a function of 3 variables, we could take several level surfaces and animate them (with time being the 4th dimension). Here are example of animations of 4-d objects. One is a 4-cube, and the other is a morphing of a torus.

Alternatively, we may also want to consider color as a 4th dimension http://abeolson.com/images/2011/exampleSurfPlot.png

Obviously, by using both time and color we could sketch a function in 5 dimensions.

The reason that you can't tell the difference between a function and an equation is because you're defining functions the same way that high school math teachers define them. An equations is sometimes part of a function definition, but a function needs more than just an equation. Here's is an example of a function definition $$f:R^2\to{R} | for\:all (x,y)\epsilon R^2\:there\:exists\:f(x,y)\epsilon R|f(x,y) = x^2+y^2$$ The point here is that a function definition needs a universal, as well as an existential quantifier, in addition to an equation.