Specifying hamiltonian vector field at a point Suppose $M$ is an $2n$ dimensional manifold equipped with $\omega \in \Omega^2(M)$ a non degenerate, but not necessarily closed two form.
For a given function $H:M\to\mathbb{R}$, since $\omega$ is non degenerate, we can define, as usual, the hamiltonian vector field by $i_{X_H}\omega = dH$. Of course, since we we don't necessarily have $d\omega = 0$, we may lose the fact that $\mathcal{L}_{X_H}\omega = 0$. Also, we lose Darboux's Theorem to express $\omega$ locally.
Now, let $p\in M$ and $X_p \in T_pM$. I was thinking about the following question:
Can we find a function $H \in C^{\infty}(M)$ such that $X_H(p) = X_p$? It seems very reasonable for it to be true (although I don't think its true if we consider we ask for the vector fields to agree on a neighborhood).
This is my attempt.
If $(U,x_1, ...,x_{2n})$ is a chart around $p$, then we can write $X_p = \sum_iv^i\frac{\partial}{\partial x_i}(p)$, and $\omega = \sum_{i<j}f_{ij}dx_i\wedge dx_j$. To find such a function $H$, we must have that, by definition of $X_H$, $i_{X_H}\omega(p) = i_{X_p}\omega(p) = dH(p)$.
Then, we calculate:
\begin{equation}i_{X_p}\omega(p) = \sum_{i<j} f_{ij}(p)dx_i\wedge dx_j(X_P,.) = \sum_{i<j}f_{ij}(p)(v_idx_j - v_jdx_i)
\end{equation}
Aggregating these terms we get:
\begin{equation}i_{X_p}\omega(p) = \sum_{i}a_idx_i
\end{equation}
Where $a_i\in\mathbb{R}$ are constant depending on $f_{ij}(p)v_k$ (I worked this out in the case of $2n=4$).
Hence we can define $H$ locally as $H(x_1,...,x_{2n}) = \sum_ia_ix_i$, and then we have $dH(p) = \sum_{i}a_idx_i = i_{X_p}\omega(p)$. Also, we can easily extend $H$ to $M$ with partitions of unity for instance.
Now, since $\omega$ is non degenerate, the Hamiltonian vector field at each point is unique. Hence, $X_p = X_H(p)$.
I believe this argument is correct, but is there a more reasonable way to show this? Also, can we do better and get this result locally in a neighborhood of $p$?
I don't think so because this is analogous to the idea that every vector field is locally the gradient of a function, which even in the plane $\mathbb{R}^2$ is not true, and a similar approach can be used.
 A: Yes, that's essentially the idea, given $X_p$, you use non-degeneracy of $\omega$ to get the associated covector $\alpha_p:= \omega^{\flat}(X_p) = \omega_p(X_p,\cdot) = \iota_{X_p}\omega(p)$. Then, using a chart, we find a function $h$ locally such that $dh(p) = \alpha(p)$. Then, using a bump function, we cut down on the support of $h$, and then extend it to be zero elsewhere; this new function $H$ has all the properties needed.
Now suppose that you're given a vector field $\xi$ on $M$, and you want to know whether it is locally a Hamiltonian vector field (i.e whether it is true that for each $p\in M$, there is an open neighborhood $U$ such that there is a smooth $H$ such that $X_H|_U = \xi|_U$). To determine this, here's what we do. Consider the associated $1$-form via the musical isomorphism $\alpha:= \omega^{\flat}(\xi) := \omega(\xi, \cdot) =: \iota_{\xi}\omega$. The question above is entirely equivalent to asking whether locally we may write $\alpha = dH$ for some $H$. This is of course equivalent (by Poincare's lemma) to $\alpha$ being a closed $1$-form; i.e $d\alpha = 0$.
To summarize, given a vector field $\xi$, it is locally a Hamiltonian vector field (with respect to $\omega$) if and only if we have $d(\omega^{\flat}(\xi)) =d(\omega(\xi,\cdot)) = 0$. But pointwise, this can always be done.
Note that this is true regardless of the dimension of $M$, and it doesn't even require skew-symmetry of $\omega$; these statements hold simply because $\omega$ is a non-degenerate $(0,2)$ tensor field on $M$ (therefore similar statement holds for example on a  Riemannian or Pseudo-Riemannian manifold; just replace $\omega$ with $g$, the metric tensor). So, while I used the notation $\omega$, and the terminology "locally Hamiltonian" etc from Symplectic geometry, I didn't really have to.

Also, note that if you further assume $\omega$ is a closed $2$-form (hence a symplectic form), then the above condition of being "locally Hamiltonian" is equivalent (by Cartan's magic formula) to $\mathcal{L}_{\xi}\omega = 0$.
