# Need help with level curves

• July 18th 2008, 09:54 AM
esmeco
Need help with level curves
Hello everyone!(Hi)

Well,I'm having a problem drawing level curves for piecewise functions.
The problem is, how do I know which value the constant k will hold?

The function is the following:

$f(x,y)=:$
$4$ if $x^2+y^2<=16$
$sqrt(32-x^2-y^2 )$ if $16

The solution I've attempted and which I'm not sure it's correct is:
I've drawn a level curve of level 4,because it's within the domain of f(x,y)(which is $]-infinity;32]$) and it's the point where the function changes to the other branch.
Does this make sense?

Just another question,to determine the domain of the second "piece" of the function,why do we also use the sqrt(32-x^2-y^2) condition and not only just the if clause?

• July 18th 2008, 11:39 AM
flyingsquirrel
Hi
Quote:

Originally Posted by esmeco
Well,I'm having a problem drawing level curves for piecewise functions.
The problem is, how do I know which value the constant k will hold?

What is "the constant $k$" ? If you're looking for the values of $k$ in order to draw the level curves $f(x,y)=k$ then it depends on $f$. In this case I would take $k$ in $\{0,1,2,3,4\}$ because the range of $f$ is $[0,4]$.

Quote:

The function is the following:

$f(x,y)=:$
$4$ if $x^2+y^2<=16$
$sqrt(32-x^2-y^2 )$ if $16

The solution I've attempted and which I'm not sure it's correct is:
I've drawn a level curve of level 4,because it's within the domain of f(x,y)(which is $]-infinity;32]$) and it's the point where the function changes to the other branch.
Does this make sense?
The domain of $f$ is the surface $\{\langle x,y\rangle,\, x^2+y^2\leq 32\}$ that is the circle centered at the origin and which radius is $\sqrt{32}=4\sqrt2$... that's not $(-\infty,32]$ ! The level curve $f(x,y)=4$ should be a circle lying in the plane $z=4$ centered at $\langle0,0,4\rangle$ and which radius is $\sqrt{16}=4$.

Quote:

Just another question,to determine the domain of the second "piece" of the function,why do we also use the sqrt(32-x^2-y^2) condition and not only just the if clause?
What is "the $\sqrt{32-x^2-y^2}$ condition" ? The only condition I can see is that $32-x^2-y^2\geq 0$ because of the square root. As this inequality is true for $\langle x,y\rangle$ such that $16, working with the "if" clause is enough.
• July 18th 2008, 07:56 PM
esmeco
What I don't understand is,why do we use the $k$ constant with value 4 specifically?Why couldn't we use other value?
Also,in the second piece of the function why do we equal $sqrt(32-x^2-y^2)=4$?Does it have anything to do with the fact that 4 is the point where the function switches to the other branch?
• July 19th 2008, 12:32 AM
flyingsquirrel
Quote:

Originally Posted by esmeco
What I don't understand is,why do we use the $k$ constant with value 4 specifically?Why couldn't we use other value?

As I said in my previous post, the level curve $f(x,y)=4$ is a disc whereas $f(x,y)=k$ for $k\in [0,3)$ is a circle : if you do not consider the case $k=4$, you miss a "large" part of the curve. (see attachment)
Quote:

Also,in the second piece of the function why do we equal $sqrt(32-x^2-y^2)=4$?Does it have anything to do with the fact that 4 is the point where the function switches to the other branch?
When do "we" do that ? $\sqrt{32-x^2-y^2}=4$ never happens since $16. However one possibility is that this was used to check that $f$ is continuous on the circle $x^2+y^2=16$ that is at the border between the first and the second piece.
• July 19th 2008, 08:20 AM
esmeco
Thanks!
Thank you for the in-depth answers!

So,to conclude,just a few more questions:

If given a piecewise function(or anyfunction?) we must determine the range of the function in order to draw the level curves,since the possible values of k must be within the range of the function,am I right?
Also,I can't quite understand why the range of the above function is [0;4](especially the zero there!)...
• July 19th 2008, 08:40 AM
flyingsquirrel
Quote:

Originally Posted by esmeco
If given a piecewise function(or anyfunction?) we must determine the range of the function in order to draw the level curves,since the possible values of k must be within the range of the function,am I right?

Yes !

Quote:

Also,I can't quite understand why the range of the above function is [0;4](especially the zero there!)...
The range of the first piece of the function is $4$. (easy :D) For the second piece, we know that $16. Multiplying these inequalities by $-1$ we get $-16>-x^2-y^2\geq -32$. Adding $32$ gives us $16 > 32-x^2-y^2\geq 0$. Since $x\mapsto \sqrt{x}$ is an increasing function, we get from the last inequalities $\sqrt{16}>\sqrt{32-x^2-y^2}\geq \sqrt{0} \Longleftrightarrow 4>f(x,y)\geq 0$. Thus the range of the second piece of the function is $[0,4)$ and the range of the function is $[0,4)\cup{4}=[0,4]$.
• July 19th 2008, 10:45 AM
esmeco
Thanks for the reply!You've been a great help!

Just one more thing: When you have a function like $f(x,y)=sqrt(12-x^2-y^2)$ instead of a piecewise function what steps do you take to determine the range?
• July 19th 2008, 10:55 AM
Mathstud28
Quote:

Originally Posted by esmeco
Thanks for the reply!You've been a great help!

Just one more thing: When you have a function like $f(x,y)=sqrt(12-x^2-y^2)$ instead of a piecewise function what steps do you take to determine the range?

$f(x,y)=\sqrt{12-(x^2+y^2)}$

Find all relative extrema by the normal method, in other words find all $(a,b)\quad\backepsilon\frac{\partial{f}}{\partial{ x}}(a,b)=\frac{\partial{f}}{\partial{y}}(a,b)=0$ and so forth

Now once you find all those relative extrema if any satisfy $x^2+y^2<12$ then keep them, if not get rid of them

And then finally define

$g(x,y)=x^2+y^2-12$

Then you will need to solve the following sytstem of equations

$\left\{\begin{array}{cc}f_x(x,y)=g_x(x,y)\lambda\\ f_y(x,y)=g_y(x,y)\lambda\\g(x,y)=0\end{array}\righ t\}$

Now all the points that satisfy that system, take them and the ones that you found as relative extrema under the condition that $x^2+y^2<12$ test them all in the original function and your range will be from the smallest value to the largest
• July 19th 2008, 11:04 AM
flyingsquirrel
Quote:

Originally Posted by esmeco
Just one more thing: When you have a function like $f(x,y)=sqrt(12-x^2-y^2)$ instead of a piecewise function what steps do you take to determine the range?

First, find the domain of the function and then derive the range from it. In this case the domain is such that $12-x^2-y^2>0$ because of the square root hence $x^2+y^2<12$. We also have $x^2+y^2\geq 0$, which gives, when put with the previous inequality : $0\leq x^2+y^2<12$. Doing the same algebraic manipulations than in my previous post you'll get $0<\sqrt{12-x^2-y^2}\leq \sqrt{12}$.
• July 19th 2008, 11:44 AM
esmeco
Shouldn't the domain of the function be $32-x^2-y^2\geq 0$ ?

In a function like f(x,y)=-x^4-y^4+4 what woulde be the range?
• July 19th 2008, 11:16 PM
flyingsquirrel
Quote:

Originally Posted by esmeco
Shouldn't the domain of the function be $32-x^2-y^2\geq 0$ ?

Quote:

Originally Posted by esmeco
[...] a function like $f(x,y)=sqrt(12-x^2-y^2)$ [...]

so the domain is $12-x^2-y^2\geq 0$. Where would 32 come from ?
Quote:

In a function like f(x,y)=-x^4-y^4+4 what woulde be the range?
The domain of this function is $\mathbb{R}^2$. For two real numbers $x$ and $y$, $x^4+y^4\geq0$ hence $-x^4-y^4+4 \leq 4 \Longleftrightarrow f(x,y)\leq 4$. ( $4$ is reached at $(0,0)$) For $x=0$, we also have $f(0,y) = -y^4+4 \underset{y\to\infty}{\to} -\infty$ thus the range is $(-\infty,4]$.
• July 20th 2008, 06:57 AM
esmeco
...
I'm getting it...The problem is when we have a function like $f(x,y)=x^2+2y-4$ ,how do we handle the 2y?

We know that $x^2 \ge 0$ and substracting 4 to both memebers gives us $x^2 -4\ge -4$.But how about the 2y?Do we had 2y in both sides?

Also,in the other post you've put variable x=0.Why did you use valor 0 for x?Could we do the same here not only to x=0 but to y=0 and solve for each?
• July 20th 2008, 11:20 AM
flyingsquirrel
Quote:

Originally Posted by esmeco
I'm getting it...The problem is when we have a function like $f(x,y)=x^2+2y-4$ ,how do we handle the 2y?

In this case we can't find the range using these inequalities any longer. It worked well with the other functions but it was a special case. $x$ and $y$ had the same "importance" $f(x,y)=f(y,x)$ and the functions were not too complicated.

Quote:

Also,in the other post you've put variable x=0.Why did you use valor 0 for x?
I could have chosen any other value, the result would have been the same. I chose to fix $x$ but I could also have chosen to fix $y$.
Quote:

Could we do the same here not only to x=0 but to y=0 and solve for each?
I'm not sure to understand what you mean by "solve" but yes, we can find the range using limits, for example with $\lim_{y\to \pm \infty} f(0,y)$ or with $\lim_{y\to \pm \infty} f(42,y)$. (note that we can get the range using limits because the function is continuous on its domain, this method doesn't always work)