I have the following vectors: \begin{equation} \begin{array}{lccrccrcc} U & = & \left( \begin{array}{c} h\\ hu \end{array} \right) & F & =\left( \begin{array}{c} hu\\ hu^{2}+\frac{1}{2}gh^{2} \end{array} \right) \end{array} \end{equation}
I need to compute the jacobian matrix $A(U) =\frac{\partial F}{\partial U}$ and I have found in some books that the jacobian, for this case, is given by: \begin{equation} \begin{array}{ccc} A(U) & = & \left( \begin{array}{cc} 0 &1\\ gh - u^2 & 2u \end{array} \right) \end{array} \end{equation} But I don't understand why! For me, it should be: \begin{equation} \begin{array}{ccc} A(U) & = & \left( \begin{array}{cc} 1 &0\\ gh + u^2 & 2u \end{array} \right) \end{array} \end{equation} I know that this jacobian is correct because these equations are part of a very known system, called "shallow water equations" and many papers mention that this is, in fact, the jacobian matrix. Can you help me to find my error on the definition of the jacobian matrix?
One thing you need to be careful about: Your coordinates for $U$ are $h$ and $hu$, but that is not a pair of independent variables, so we need to rewrite it:
let $v = hu$. Then we have $$U = \begin{pmatrix}h\\v\end{pmatrix}$$ and $$F = \begin{pmatrix}h\\\frac{v^2}h + \frac 12gh^2\end{pmatrix}$$
So $$\frac{\partial F_1}{\partial v} = 0\qquad\frac{\partial F_1}{\partial h} = 1$$ $$\frac{\partial F_2}{\partial v} = 2\frac vh = 2u$$ $$\frac{\partial F_2}{\partial h} = -\frac{v^2}{h^2} + gh = gh - u^2$$
This explains the minus sign.
But I see no way of explaining the reversal of $0$ and $1$. One can suppose that they ordered their rows and columns differently (it is an arbitrary choice), but no matter how you look at it, the $0$ belongs in the same column as $2u$ and the $1$ in the same column as $gh - u^2$. You can exchange entire columns or entire rows without changing anything important. But you cannot exchange only half of a column.
Did you check your sources carefully to make sure they were defining $U$ and $F$ exactly the same as you have them?
Edit After $F$ was corrected in the OP $$F = \begin{pmatrix}v\\\frac{v^2}h + \frac 12gh^2\end{pmatrix}$$ So now $$\frac{\partial F_1}{\partial v} = 1\qquad\frac{\partial F_1}{\partial h} = 0$$ as required.