Trying to get a handle on some multivariable calculus stuff. I have a handle on calculating a derivative of $f$ where $f$ takes in an $\mathbb{R}^2$ input and has an $\mathbb{R}^1$ output (which would generally be $\nabla f(x,y)$) and for there derivative of $f$ where the input is in $\mathbb{R}^1$ and the output is in $\mathbb{R}^2$ (which would generally be $\frac{dx(t)}{dt} \hat{i} + \frac{dy(t)}{dt} \hat{j} $ if $x(t)$ and $y(t)$ are the parameterization of $f$.
I'm trying to figure out what the dervative of $f$ would be if it maps $\mathbb{R}^2 \rightarrow \mathbb{R}^2$.
As an example, let's say $f(x\hat i + y \hat j) = g(x,y) \hat i + h(x,y) \hat j$.  What would the sensible notion of a derivative be in this case?  I feel like it would be $\nabla f$, but I'm also at a bit of a loss as to how to calculate that.
EDIT:
Okay, I think I figured it out, so let me know if this is correct.
Given $f(x, y) = g(x, y) \hat i + h(x,y) \hat j$, compute $\nabla f$.
$\nabla f(x,y) = \frac{\partial g}{\partial x} \hat i + \frac{\partial h}{\partial y}\hat j$.
Correct?
 A: Adding some color to the above answer, lets try this using first principles.  The notation can get a little weird to use i,j,k vectors so lets just look at say vectors $f(x,y)=(g(x,y),h(x,y)).$ Look at a perturbation of $f$,
$$
f(x+\epsilon,y+\delta )-f(x,y) = (g(x+\epsilon ,y+\delta )-g(x,y),h(x+\epsilon ,y+\delta )-h(x,y)) =(\frac{\partial g}{\partial x}\epsilon  +\frac{\partial g}{\partial y}\delta ,\frac{\partial h}{\partial x}\epsilon  +\frac{\partial h}{\partial y}\delta ) + o(|(\epsilon,\delta)|).
$$
You can then rearrange the equation using linear algebra to say
$$
f(x+\epsilon,y+\delta )-f(x,y) =\left(
\begin{matrix}
\frac{\partial g}{\partial x}& \frac{\partial g}{\partial y}\\
\frac{\partial h}{\partial x}& \frac{\partial h}{\partial y}\\
\end{matrix}\right)
\left(\begin{matrix}
\epsilon \\
\delta\\
\end{matrix}\right)+o(|\epsilon,\delta)|).
$$
You can see now in the  the limit as $(\epsilon, \delta)\to 0$ you get a matrix derivative.
A: It is what is called the "Jacobian matrix":
$$ \left( \begin{array}{cc}
\frac{\partial g}{\partial x} & \frac{\partial g}{\partial y} \\
\frac{\partial h}{\partial x} & \frac{\partial h}{\partial y}
\end{array} \right)
$$
The rows of the matrix are the gradients of $g$ and $h$.
