Hey!!

I want to draw the contour line of the function $\displaystyle{y=f(x_1, x_2)=-0,1x_1^2-0,4x_2^2}$ at $y=-2,5$ and at the point $(3,-2)$ I want to draw the gradient.

We have the following: \begin{equation*} y=-2,5 \Rightarrow -0,1x_1^2-0,4x_2^2=-2,5 \Rightarrow -10\cdot \left (-0,1x_1^2-0,4x_2^2\right )=-10\cdot \left (-2,5\right )\Rightarrow x_1^2+4x_2^2=25 \Rightarrow x_1^2=25-4x_2^2 \\ \Rightarrow x_1=\pm \sqrt{25-4x_2^2} \end{equation*}

So that the root is well-defined it must be \begin{align*}25-4x_2^2\geq 0 &\Rightarrow 5^2-(2x_2)^2\geq 0 \\ &\Rightarrow (5-2x_2)(5+2x_2)\geq 0 \\ &\Rightarrow \left (5-2x_2>0 \text{ and } 5+2x_2 >0 \right )\ \ \text{ or } \ \ \left (5-2x_2<0 \text{ and } 5+2x_2< 0 \right ) \\ &\Rightarrow \left (x_2<\frac{5}{2} \text{ and } x_2 >-\frac{5}{2}\right ) \ \ \text{ or } \ \ \left (x_2>\frac{5}{2} \text{ and } x_2<-\frac{5}{2}\right )\end{align*}

Since it cannot be that $\left (x_2>\frac{5}{2} \text{ and } x_2<-\frac{5}{2}\right )$ it must be $\left (x_2<\frac{5}{2} \text{ and } x_2 >-\frac{5}{2}\right )$.

We get the following table:

$\begin{matrix}

x_2 & -2 & -1 & 0 & 1 & 2\\

x_1 & \pm 3 & \pm \sqrt{21} & \pm 5 & \pm \sqrt{21} & \pm 3

\end{matrix}$

So, the contour line is the following:

Is this correct?

We have that $f_{x_1}=-0,2x_1$ and $f_{x_2}=-0,8x_2$. So, the gradient is $\nabla f=\begin{pmatrix}-0,2x_1\\ -0,8x_2\end{pmatrix}$.

At the point $(3,-2)$ it is $\nabla f(3,-2)=\begin{pmatrix}-0,6\\ 1,6\end{pmatrix}$.

How can we draw it at the graph above?