Which of the following is gradient/Hamiltonian( Conservative) system

A system of ordinary differential equations of the form

$$ \dot{x}=f(x,y)\\ \dot{y}=g(x,y) $$

is called Hamiltonian if there exists a function $H(x,y)$ such that

$$ f(x,y)=\frac{\partial}{\partial y}H(x,y)\\ g(x,y)=-\frac{\partial}{\partial x}H(x,y). $$

To check if such a function exists, we need to check the following:

$$ \frac{\partial }{\partial x}f(x,y)+\frac{\partial}{\partial y}g(x,y)=0 $$

Why do we check this? Well, (assuming that $H$ has continuous second partials), we must have $$ \frac{\partial^2H}{\partial x\partial y}=\frac{\partial^2 H}{\partial y\partial x}\\ \Longrightarrow\frac{\partial}{\partial x}f(x,y)=\frac{\partial^2H}{\partial x\partial y}=\frac{\partial^2 H}{\partial y\partial x}=-\frac{\partial }{\partial y}g(x,y) $$ and hence $f_x+g_y=0$.

On the other hand, a system is called a Gradient system if there is a function $F$ such that

$$ \dot{X}=-\nabla F $$ where $X=[x,y]^\intercal$ and $F:\Bbb{R}^2\rightarrow\Bbb{R}$. Some books will use $\dot{X}=\nabla F$ instead (no negative sign) so watch out for that.

This would mean that we need a function such that $f(x,y)=-\frac{\partial}{\partial x}F$ and $g(x,y)=-\frac{\partial}{\partial y}F$.

One way to check if such a funciton exists is to check if the vector field $\vec{F}(x,y)=f(x,y)\hat{\imath}+g(x,y)\hat{\jmath}$ is path-independent (or conservative). This is done by checking the condition:

$$ \frac{\partial}{\partial y}f(x,y)=\frac{\partial}{\partial x}g(x,y) $$

Then, if this holds for all $(x,y)\in\Bbb{R}^2$, you can start constructing a potential $H$; for simple systems, this can usually be done by "inspection". For more complicated systems, you'll need to go through an integration process to find $H$. For a video on this process, see here.