# Thread: Need help with level curves

1. ## Need help with level curves

Hello everyone!

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:

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

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 $\displaystyle ]-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?

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

The function is the following:

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

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 $\displaystyle ]-infinity;32]$) and it's the point where the function changes to the other branch.
Does this make sense?
The domain of $\displaystyle f$ is the surface $\displaystyle \{\langle x,y\rangle,\, x^2+y^2\leq 32\}$ that is the circle centered at the origin and which radius is $\displaystyle \sqrt{32}=4\sqrt2$... that's not $\displaystyle (-\infty,32]$ ! The level curve $\displaystyle f(x,y)=4$ should be a circle lying in the plane $\displaystyle z=4$ centered at $\displaystyle \langle0,0,4\rangle$ and which radius is $\displaystyle \sqrt{16}=4$.

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 $\displaystyle \sqrt{32-x^2-y^2}$ condition" ? The only condition I can see is that $\displaystyle 32-x^2-y^2\geq 0$ because of the square root. As this inequality is true for $\displaystyle \langle x,y\rangle$ such that $\displaystyle 16<x^2+y^2\leq 32$, working with the "if" clause is enough.

3. What I don't understand is,why do we use the $\displaystyle 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 $\displaystyle 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?

4. Originally Posted by esmeco
What I don't understand is,why do we use the $\displaystyle k$ constant with value 4 specifically?Why couldn't we use other value?
As I said in my previous post, the level curve $\displaystyle f(x,y)=4$ is a disc whereas $\displaystyle f(x,y)=k$ for $\displaystyle k\in [0,3)$ is a circle : if you do not consider the case $\displaystyle k=4$, you miss a "large" part of the curve. (see attachment)
Also,in the second piece of the function why do we equal $\displaystyle 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 ? $\displaystyle \sqrt{32-x^2-y^2}=4$ never happens since $\displaystyle 16<x^2+y^2\leq 32 \implies 0\leq \sqrt{32-x^2-y^2} < 4$. However one possibility is that this was used to check that $\displaystyle f$ is continuous on the circle $\displaystyle x^2+y^2=16$ that is at the border between the first and the second piece.

5. ## 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!)...

6. 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 !

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 $\displaystyle 4$. (easy ) For the second piece, we know that $\displaystyle 16<x^2+y^2\leq 32$. Multiplying these inequalities by $\displaystyle -1$ we get $\displaystyle -16>-x^2-y^2\geq -32$. Adding $\displaystyle 32$ gives us $\displaystyle 16 > 32-x^2-y^2\geq 0$. Since $\displaystyle x\mapsto \sqrt{x}$ is an increasing function, we get from the last inequalities $\displaystyle \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 $\displaystyle [0,4)$ and the range of the function is $\displaystyle [0,4)\cup{4}=[0,4]$.

7. Thanks for the reply!You've been a great help!

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

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

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

Find all relative extrema by the normal method, in other words find all $\displaystyle (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 $\displaystyle x^2+y^2<12$ then keep them, if not get rid of them

And then finally define

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

Then you will need to solve the following sytstem of equations

$\displaystyle \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 $\displaystyle x^2+y^2<12$ test them all in the original function and your range will be from the smallest value to the largest

9. Originally Posted by esmeco
Just one more thing: When you have a function like $\displaystyle 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 $\displaystyle 12-x^2-y^2>0$ because of the square root hence $\displaystyle x^2+y^2<12$. We also have $\displaystyle x^2+y^2\geq 0$, which gives, when put with the previous inequality : $\displaystyle 0\leq x^2+y^2<12$. Doing the same algebraic manipulations than in my previous post you'll get $\displaystyle 0<\sqrt{12-x^2-y^2}\leq \sqrt{12}$.

10. Shouldn't the domain of the function be $\displaystyle 32-x^2-y^2\geq 0$ ?

In a function like f(x,y)=-x^4-y^4+4 what woulde be the range?

11. Originally Posted by esmeco
Shouldn't the domain of the function be $\displaystyle 32-x^2-y^2\geq 0$ ?
Originally Posted by esmeco
[...] a function like $\displaystyle f(x,y)=sqrt(12-x^2-y^2)$ [...]
so the domain is $\displaystyle 12-x^2-y^2\geq 0$. Where would 32 come from ?
In a function like f(x,y)=-x^4-y^4+4 what woulde be the range?
The domain of this function is $\displaystyle \mathbb{R}^2$. For two real numbers $\displaystyle x$ and $\displaystyle y$, $\displaystyle x^4+y^4\geq0$ hence $\displaystyle -x^4-y^4+4 \leq 4 \Longleftrightarrow f(x,y)\leq 4$. ($\displaystyle 4$ is reached at $\displaystyle (0,0)$) For $\displaystyle x=0$, we also have $\displaystyle f(0,y) = -y^4+4 \underset{y\to\infty}{\to} -\infty$ thus the range is $\displaystyle (-\infty,4]$.

12. ## ...

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

We know that $\displaystyle x^2 \ge 0$ and substracting 4 to both memebers gives us $\displaystyle 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?

13. Originally Posted by esmeco
I'm getting it...The problem is when we have a function like $\displaystyle 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. $\displaystyle x$ and $\displaystyle y$ had the same "importance" $\displaystyle f(x,y)=f(y,x)$ and the functions were not too complicated.

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 $\displaystyle x$ but I could also have chosen to fix $\displaystyle y$.
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 $\displaystyle \lim_{y\to \pm \infty} f(0,y)$ or with $\displaystyle \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)