Given a planar system, show that $H$ is constant along solutions Let $\mathbf{x}=[x_1\quad x_2]^T$ and consider the system $$\begin{bmatrix}\dot x_1 \\\dot x_2\end{bmatrix}=\begin{bmatrix}f_1(x_1,x_2)\\f_2(x_1,x_2)\end{bmatrix}.$$ Let also a function $H:\mathbb{R}^2\to\mathbb{R}$ such that $$f_1(x_1,x_2)=\frac{\partial H(x_1,x_2)}{\partial x_2}\quad\text{and}\quad f_2=-\frac{\partial H(x_1,x_2)}{\partial x_1}.$$
I'd like to show that $H$ is constant along solutions of the system (is $H$ a special function, does it have a name?). Now I am not sure what's the exact meaning of "along" here but here is my attempt.
I am assuming that the dot means time-derivative. Now since $\dot x_1=\frac{\partial H(x_1,x_2)}{\partial x_2}$, I can integrate and get $$\int dx_1\partial x_2=\int\partial H(x_1,x_2)dt,$$ similarly we have $$\int dx_2\partial x_1=-\int\partial H(x_1,x_2)dt.$$ This implies that $$\int\partial H(x_1,x_2)dt=-\int\partial H(x_1,x_2)dt$$ which is only possible if $H$ is a constant function.
Is my math right or did I do something wrong?
 A: Along means that if $(x_1(t),x_2(t))$ is a solution, then
$$
H(x_1(t),x_2(t))=const
$$
For that to be the case, you need $dH/dt=0$, that is
$$
\frac{\partial H}{\partial x_1}x_1'(t)+\frac{\partial H}{\partial x_2}x_2'(t)=0
$$
which, given your system, means
$$
\frac{\partial H}{\partial x_1}f_1(x_1,x_2)+\frac{\partial H}{\partial x_2}f_2(x_1,x_2)=0
$$
Quantities like $H$ are called first integrals, and typically correspond to energy, momentum, etc. which are preserved along the orbits of your system.
A: One can also do it like this:
$\dfrac{d}{dt} (H(x_1, x_2)) = \dfrac{\partial H}{\partial x_1} \dfrac{dx_1}{dt} + \dfrac{\partial H}{\partial x_2} \dfrac{dx_2}{dt} = -f_2f_1 + f_1f_2 = 0, \tag 1$
which shows that $H(x_1, x_2)$ is constant along the integral curves $(x_1(t), x_2(t))$ of the ordinary differential equation
$\begin{pmatrix} \dot x_1 \\ \dot x_2 \end{pmatrix} = \begin{pmatrix} f_1(x_1, x_2) \\ f_2(x_1, x_2) \end{pmatrix}. \tag 2$
The function $H(x_1, x_2)$ indeed has a special name:  it is called the Hamiltonian of the system (2).  In classical physics, it is usually thought of as energy.  Thus, (1) is a statement of conservation of energy.
A: Hint: Observe
\begin{align}
\frac{d}{dt}H(x_1(t), x_2(t)) = \frac{\partial H}{\partial x_1}\frac{dx_1}{dt}+\frac{\partial H}{\partial x_2}\frac{dx_2}{dt}
\end{align}
