# Find gradient of $f(x,y)$ with given directional derivatives

Given $f(x,y)$ differentiable at $(a,b)$ and $D_{\left(\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}}\right)} f(a,b)=3$, $D_{\left(\frac{1}{\sqrt{2}},-\frac{1}{\sqrt{2}}\right)}f(a,b)=1$, find $f_x(a,b)$ and $f_y(a,b)$.

I know $D_af= \mathrm{grad}(f) ⋅ a = a_1⋅f_x + a_2⋅f_y$.

In that case, I'd have \begin{equation} D_{\left(\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}}\right)}f(a,b)= \frac{1}{\sqrt{2}}f_x(a,b) + \frac{1}{\sqrt{2}}f_y(a,b) \end{equation} I have tried to go about this by breaking up the equation, but don't know how to incorporate 3 and 1 to find the gradient.

• thank you for the edit.. I tried looking up how to do the square root but couldn't find info anywhere. – B.can Jun 1 '18 at 9:12

## 1 Answer

As you say \begin{equation} D_{\left(\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}}\right)}f(a,b)= \frac{1}{\sqrt{2}}f_x(a,b) + \frac{1}{\sqrt{2}}f_y(a,b). \end{equation} The left hand side is equal to 3 by assumption. Similarly \begin{equation} 1 = D_{\left(\frac{1}{\sqrt{2}},-\frac{1}{\sqrt{2}}\right)}f(a,b)= \frac{1}{\sqrt{2}}f_x(a,b) - \frac{1}{\sqrt{2}}f_y(a,b). \end{equation} You get a linear system where the unknowns are exactly $f_x(a,b)$ and $f_y(a,b)$.

• In that case, would $f_x(a,b)$=5 and $f_y(a,b)$= sqrt{2}/2... sorry if my formatting is off, still trying to figure this out. – B.can Jun 1 '18 at 9:18
• You have $3\sqrt{2} = f_x+f_y$ and $\sqrt{2} = f_x - f_y$. Your solution does not work... – Gibbs Jun 1 '18 at 9:21
• Oh, you factored out the coefficients. I forgot to subtract the 3 and the 1 when solving the equations. I got $f_x(a,b)$=2$\sqrt{2}$ and $f_y(a,b)$=$\sqrt{2}$ – B.can Jun 1 '18 at 9:31
• Now it works. Remember that the command for the square root is \sqrt{ }. – Gibbs Jun 1 '18 at 9:32
• figured out the problem and the command. thank you. – B.can Jun 1 '18 at 9:34