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?
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.