Welcome to our community

Be a part of something great, join today!

Level lines and gradient

mathmari

Well-known member
MHB Site Helper
Apr 14, 2013
4,601
Hey!! :giggle:

We consider the function $f:\mathbb{R}^2\rightarrow \mathbb{R}$ with $$f(x,y)=\frac{x^2-1}{y^2+1}$$
(a) Describe and draw the level lines $N_c$ of $f$ for all $c\in \mathbb{R}$. Determine for each connected component of each non-empty level lines $N_c$ a parametrization $\gamma_c:I\rightarrow \mathbb{R}$.
(b) Calculate the gradient $\nabla f(\gamma_c(t))$ of $f$ in the point $\gamma_c(t)\in \mathbb{R}^2$. Show directly that $\nabla f(\gamma_c(t))$ is orthogonal to the level lines $N_c$ at the point $\gamma_c(t)$.
(c) Let $x\in \mathbb{R}^2$, such that $\nabla f(x)\neq 0$. Determine the direction with maximum directional derivative of $f$ in point $x$.


For (a) :
We have that $$f(x,y)=c \Rightarrow \frac{x^2-1}{y^2+1}=c \Rightarrow x^2-1=(y^2+1)c \Rightarrow x^2-cy^2-(c+1)=0$$
If $c=0$ then we have $x^2=1 \Rightarrow x\pm 1$, so we get the lines $x=1$ and $x=-1$.
If $c>0$ we have then $c=m^2>0$. So $x^2-m^2y^2-(m^2+1)=0 \Rightarrow x^2-m^2y^2=(m^2+1)$. We have $B^2-4AC=0-4\cdot 1\cdot (-m^2)=m^2>0$. So it is the general equation of an hyperbola with axes parallel to the coordinate axes.
If $c<0$ we have then $c=-m^2<0$. So $x^2+m^2y^2-(-m^2+1)=0 \Rightarrow x^2+m^2y^2=(-m^2+1)$. The left side is always non-negative, so also the right side must be. So $1-m^2\geq0 \Rightarrow m^2\leq1 \Rightarrow -1\leq -m^2 \Rightarrow -1\leq c$. That means that is $c$ is negative then $c$ must be greater or equal to $-1$. If $-1<c<0$ then we have the general formula of an ellipse. If $c=-1$ then we get $x^2+y^2=0$ which is the point $(0,0)$.

Is that correct?

How do we determine for each connected component of each non-empty level lines $N_c$ a parametrization $\gamma_c:I\rightarrow \mathbb{R}$ ?

:unsure:


For (b) :
We have that $$\nabla f(x,y)=\frac{2x}{y^2+1}\hat{i}+\frac{-2(x^2-1)y}{(y^2+1)^2}\hat{j}$$ But how do we get $\nabla f(\gamma_c(t))$ ? :unsure:


For (c) :
The maximum value of the directional derivative occurs when $\nabla f$ and the unit vector point in the same direction.
But how can we find that? Dowenot need aspecific point here? :unsure:
 
Last edited:

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,417
For (a) :
We have that $$f(x,y)=c \Rightarrow \frac{x^2-1}{y^2+1}=c \Rightarrow x^2-1=(y^2+1)c \Rightarrow x^2-cy^2-(c+1)=0$$
If $c=0$ then we have $x^2=1 \Rightarrow x\pm 1$, so we get the lines $x=1$ and $x=-1$.
If $c>0$ we have then $c=m^2>0$. So $x^2-m^2y^2-(m^2+1)=0 \Rightarrow x^2-m^2y^2=(m^2+1)$. We have $B^2-4AC=0-4\cdot 1\cdot (-m^2)=m^2>0$. So it is the general equation of an hyperbola with axes parallel to the coordinate axes.
If $c<0$ we have then $c=-m^2<0$. So $x^2+m^2y^2-(-m^2+1)=0 \Rightarrow x^2+m^2y^2=(-m^2+1)$. The left side is always non-negative, so also the right side must be. So $1-m^2\geq0 \Rightarrow m^2\leq1 \Rightarrow -1\leq -m^2 \Rightarrow -1\leq c$. That means that is $c$ is negative then $c$ must be greater or equal to $-1$. If $-1<c<0$ then we have the general formula of an ellipse. If $c=-1$ then we get $x^2+y^2=0$ which is the point $(0,0)$.
Hey mathmari !!

Looks correct to me. (Nod)

How do we determine for each connected component of each non-empty level lines $N_c$ a parametrization $\gamma_c:I\rightarrow \mathbb{R}$ ?
So we have ellipses and hyperbolas.
A possible parametrization is $(a\cos t, b\cos t)$ respectively $(a\cosh t, b\cosh t)$.
Can we find the corresponding $a$ and $b$ for a specific $c$? 🤔

If we do so, we can get:
\begin{tikzpicture}
\clip (-4,-4) rectangle (4,4);
\draw[help lines] (-4,-4) grid (4,4);
\draw[-latex] (-4,0) -- (4,0);
\draw[-latex] (0,-4) -- (0,4);
\draw foreach \i in {-3,...,3} { (\i,0.1) -- (\i,-0.1) node[below] {$\i$} };
\draw foreach \i in {-3,...,3} { (0.1,\i) -- (-0.1,\i) node[ left ] {$\i$} };
\foreach \c in {-.9,-.7,...,-.1} {
\draw[domain=0:360, variable=\t] plot ({sqrt(1+\c)*cos(\t)}, {sqrt(-1-1/\c)*sin(\t)});
}
\foreach \c in {0.1,0.2,...,3} {
\draw[domain=-5:5, variable=\t, smooth] plot ({-sqrt(1+\c)*cosh(\t)}, {sqrt(1+1/\c)*sinh(\t)});
\draw[domain=-5:5, variable=\t, smooth] plot ({sqrt(1+\c)*cosh(\t)}, {sqrt(1+1/\c)*sinh(\t)});
}
\draw (-1,-4) -- (-1,4);
\draw (1,-4) -- (1,4);
\end{tikzpicture}
🤔

For (b) :
We have that $$\nabla f(x,y)=\frac{2x}{y^2+1}\hat{i}+\frac{-2(x^2-1)y}{(y^2+1)^2}\hat{j}$$ But how do we get $\nabla f(\gamma_c(t))$ ?
First we'll need to find $\gamma_c(t)$, which we can then substitute. :unsure:

For (c) :
The maximum value of the directional derivative occurs when $\nabla f$ and the unit vector point in the same direction.
But how can we find that? Do we not need a specific point here?
We can also tell by looking at the graph of the level curves.
The gradient is highest where the curves are closest together.
Where is that? 🤔
 

mathmari

Well-known member
MHB Site Helper
Apr 14, 2013
4,601
So we have ellipses and hyperbolas.
A possible parametrization is $(a\cos t, b\cos t)$ respectively $(a\cosh t, b\cosh t)$.
Can we find the corresponding $a$ and $b$ for a specific $c$? 🤔
For the ellipse we have $$x^2-cy^2-(c+1)=0 \Rightarrow x^2-cy^2=(c+1) \Rightarrow \frac{x^2}{\sqrt{c+1}^2}+\frac{y^2}{\left (\sqrt{\frac{c+1}{-c}}\right )^2}=1$$ So does that mean that $a=\sqrt{c+1}$ and $b=\sqrt{\frac{c+1}{-c}}$ with $-1<c<0$ ?

So is a parametrization $\gamma_c=\left (\sqrt{c+1}\cos(t), \sqrt{\frac{c+1}{-c}}\sin (t)\right )$ ?


For the hyperbola we have $$x^2-cy^2-(c+1)=0 \Rightarrow x^2-cy^2=(c+1) \Rightarrow \frac{x^2}{\sqrt{c+1}^2}-\frac{y^2}{\left (\sqrt{\frac{c+1}{c}}\right )^2}=1$$ So does that mean that $a=\sqrt{c+1}$ and $b=\sqrt{\frac{c+1}{c}}$ with $c>0$ ?

So is a parametrization $\gamma_c=\left (\sqrt{c+1}\cosh(t), \sqrt{\frac{c+1}{c}}\sinh (t)\right )$ ?


Do we have to consider also the cases $c=0$ and $c=-1$ ?


:unsure:
 

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,417
So is a parametrization $\gamma_c=\left (\sqrt{c+1}\cos(t), \sqrt{\frac{c+1}{-c}}\sin (t)\right )$ ?
Yep. (Nod)

So is a parametrization $\gamma_c=\left (\sqrt{c+1}\cosh(t), \sqrt{\frac{c+1}{c}}\sinh (t)\right )$ ?
This only covers the parts of the hyperbolas with positive x. :rolleyes:

Do we have to consider also the cases $c=0$ and $c=-1$ ?
I guess so. After all, the question asks for each connected component of non-empty level curves.
So we should add them for completeness. 🤔
 

mathmari

Well-known member
MHB Site Helper
Apr 14, 2013
4,601
This only covers the parts of the hyperbolas with positive x. :rolleyes:
Do you mean to take at each $a$ and $b$ also the minus sign?
I mean: $\gamma_c=\left (\pm\sqrt{c+1}\cos(t), \pm\sqrt{\frac{c+1}{-c}}\sin (t)\right )$ and $\gamma_c=\left (\pm\sqrt{c+1}\cosh(t), \pm \sqrt{\frac{c+1}{c}}\sinh (t)\right )$ ? :unsure:


I guess so. After all, the question asks for each connected component of non-empty level curves.
So we should add them for completeness. 🤔
For $c=0$ we have the lines $x=\pm1$. Is a parametrization $\gamma_0(t)=(t,0)$ ? :unsure:

For $c=-1$ we have the point $(0,0)$. Is a parametrization $\gamma_{-1}(t)=(0,0)$ ? :unsure:
 
Last edited by a moderator:

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,417
Do you mean to take at each $a$ and $b$ also the minus sign? I mean:
$\gamma_c=\left (\pm\sqrt{c+1}\cosh(t), \pm \sqrt{\frac{c+1}{c}}\sinh (t)\right )$ ?
No need to invert the y-coordinate.
We have both:
$$\gamma_c^+(t)=\left (\sqrt{c+1}\cosh(t), \sqrt{\frac{c+1}{c}}\sinh (t)\right )$$
and:
$$\gamma_c^-(t)=\left (-\sqrt{c+1}\cosh(t), \sqrt{\frac{c+1}{c}}\sinh (t)\right )$$
which are the two unconnected components of the same hyperbola. 🧐

For $c=0$ we have the lines $x=\pm1$. Is a parametrization $\gamma_0(t)=(t,0)$ ?
Suppose we substitute $t=2$, then we get $(2,0)$.
That doesn't have $x=\pm1$. Furthermore, $y$ is not restricted to be $0$ is it? :oops:

For $c=-1$ we have the point $(0,0)$. Is a parametrization $\gamma_{-1}(t)=(0,0)$ ?
Yep. (Nod)
 
Last edited:

mathmari

Well-known member
MHB Site Helper
Apr 14, 2013
4,601
No need to invert the y-coordinate.
We have both:
$$\gamma_c^+(t)=\left (\sqrt{c+1}\cos(t), \sqrt{\frac{c+1}{-c}}\sin (t)\right )$$
and:
$$\gamma_c^-(t)=\left (-\sqrt{c+1}\cos(t), \sqrt{\frac{c+1}{-c}}\sin (t)\right )$$
which are the two unconnected components of the same hyperbola. 🧐
In that way we write both the hyperbola and the ellipse, or not? :unsure:



Suppose we substitute $t=2$, then we get $(2,0)$.
That doesn't have $x=\pm1$. Furthermore, $y$ is not restricted to be $0$ is it? :oops:
Ah yes! So is the parametrization $\gamma_0(t)=(1,t)$ ? :unsure:
 

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,417
In that way we write both the hyperbola and the ellipse, or not?
My mistake. I meant to write $\cosh$ and $\sinh$. (Blush)
They were just for the hyperbola.
I've corrected that in my previous post now.

Oh, and we don't need $\pm$ for the ellipse at all. The parametrization already covers the whole ellipse, which is one connected component after all. :geek:

Ah yes! So is the parametrization $\gamma_0(t)=(1,t)$ ?
Yes... but that is only for $x=+1$. We are still missing $x=-1$. 🧐
 

mathmari

Well-known member
MHB Site Helper
Apr 14, 2013
4,601

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,417
Why do we need to do that only for the hyperbola?
Because a hyperbola consists of 2 disconnected parts.
The parametrization $(a\cosh t, b\sinh t)$ is only for the part with positive x.
When we put a minus ($-$) before the x-coordinate, we effectively mirror it in the y-axis so that we get the part with negative x.
But when we mirror an ellipse in the y-axis, we just get the same ellipse. (Nerd)

Oh yes! It must be $\gamma_0(t)=(\pm 1, t)$, right?
Yep. (Nod)
 

mathmari

Well-known member
MHB Site Helper
Apr 14, 2013
4,601
Because a hyperbola consists of 2 disconnected parts.
The parametrization $(a\cosh t, b\sinh t)$ is only for the part with positive x.
When we put a minus ($-$) before the x-coordinate, we effectively mirror it in the y-axis so that we get the part with negative x.
But when we mirror an ellipse in the y-axis, we just get the same ellipse. (Nerd)
Ahh ok!!


At question (b): Do we substitute at $\nabla f(x,y)=\frac{2x}{y^2+1}\hat{i}+\frac{-2(x^2-1)y}{(y^2+1)^2}\hat{j}$ the parametrizations? Or do we calculate first $f(\gamma_c(t))$ and then the derivative? :unsure:
 

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,417
At question (b): Do we substitute at $\nabla f(x,y)=\frac{2x}{y^2+1}\hat{i}+\frac{-2(x^2-1)y}{(y^2+1)^2}\hat{j}$ the parametrizations? Or do we calculate first $f(\gamma_c(t))$ and then the derivative?
The derivative $\frac d{dt}\left (f(\gamma_c(t))\right)$ is something different isn't it? 🤔
 

mathmari

Well-known member
MHB Site Helper
Apr 14, 2013
4,601
Yes!

At the second part of the question we have to use the partial derivative and the dot product, or not ? :unsure:



We can also tell by looking at the graph of the level curves.
The gradient is highest where the curves are closest together.
Where is that? 🤔
At x=2 ans x=-2? :unsure:
 

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,417

mathmari

Well-known member
MHB Site Helper
Apr 14, 2013
4,601

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,417
I meant the gradient. So do we have to calculate the dot product of $\nabla f(\gamma_c(t)) $ and $\gamma_c(t) $?
Not $\gamma_c(t) $. We need a tangent vector of the level curve at $\gamma_c(t)$. 🤔
 
Last edited:

mathmari

Well-known member
MHB Site Helper
Apr 14, 2013
4,601

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,417
Isn't $\dot\gamma_c(t)$ a tangent vector (if it is not 0)? 🤔
 

mathmari

Well-known member
MHB Site Helper
Apr 14, 2013
4,601
Suppose we evaluate the gradient at (x,0).
What do we get? 🤔
Will it be largest at x=2? 🤔
We get then $(2x,0)$, so the largest is not at $x=2$, but gets larger as $x$ gets larger. So how do we get the maximum? :unsure:
 
Last edited:

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,417
We get then (2x,0), so the largest is not at x=2, but gets larger as x gets larger.
Indeed. So the largest gradient is infinitely large.
Then again... perhaps that's not what the question was asking for. (Blush)

I guess we need to find the largest directional derivative at a specific point.
Since the directional derivative is the dot product of the corresponding unit vector and the gradient, it is largest if that unit vector points in the same direction as the gradient.
In other words, the direction is the same as the direction of the gradient.
And the magnitude is the same as the magnitude of the gradient. 🤔
 

mathmari

Well-known member
MHB Site Helper
Apr 14, 2013
4,601
I guess we need to find the largest directional derivative at a specific point.
Since the directional derivative is the dot product of the corresponding unit vector and the gradient, it is largest if that unit vector points in the same direction as the gradient.
In other words, the direction is the same as the direction of the gradient.
And the magnitude is the same as the magnitude of the gradient. 🤔
So the direction is \begin{equation*}\nabla f(x,y)=\frac{2x}{y^2+1}\hat{i}+\frac{-2(x^2-1)y}{(y^2+1)^2}\hat{j}=\left (\frac{2x}{y^2+1}, \ \frac{-2(x^2-1)y}{(y^2+1)^2}\right )\end{equation*} and the magnitude is \begin{equation*}\|\nabla f(x,y)\|=\sqrt{\left (\frac{2x}{y^2+1}\right )^2+\left ( \frac{-2(x^2-1)y}{(y^2+1)^2}\right )^2}\end{equation*} ? :unsure:
 

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,417
So the direction is \begin{equation*}\nabla f(x,y)=\frac{2x}{y^2+1}\hat{i}+\frac{-2(x^2-1)y}{(y^2+1)^2}\hat{j}=\left (\frac{2x}{y^2+1}, \ \frac{-2(x^2-1)y}{(y^2+1)^2}\right )\end{equation*} and the magnitude is \begin{equation*}\|\nabla f(x,y)\|=\sqrt{\left (\frac{2x}{y^2+1}\right )^2+\left ( \frac{-2(x^2-1)y}{(y^2+1)^2}\right )^2}\end{equation*} ? :unsure:
Yep. (Nod)