Let $a(x) \in W^{1, \infty}(\mathbb{R})$ be real-valued such that $a(x) \ge a_0 > 0$. Let $A^2$ denote the second order differential operator $A^2 : = -\partial_x (a(x) \partial_x) + 1 : L^2(\mathbb{R}) \to L^2(\mathbb{R})$. Equipped with the domain $H^2(\mathbb{R})$, this operator is positive, bounded below, and clearly symmetric. It is also self-adjoint because it can be shown to have closed range, and thus $A^2$ is surjective by its strict positivity.
If we take $A$ to be the positive square root of $A^2$ (as defined by the spectral theorem), one can show that $D(A) = H^1(\mathbb{R})$ (this follows from the well known fact that $D(A)$ is the form domain associated to $A^2$).
Suppose $v \in L^2(\mathbb{R})$ has the property that there exsits $v^*$ so that for all $u \in H^2(\mathbb{R})$, one has
$$ \langle v , A^2u \rangle_{L^2} = \langle v^*, A u \rangle_{L^2}. $$
I would like to conclude that $v \in H^1(\mathbb{R})$.
Assuming the above property of $v$, it would suffice to show that $A : H^2 \to H^1$ is surjective. For then one immediately has $v \in D(A^*) = D(A) = H^1$. But I'm not sure if this surjectivity holds, or if there is another style of argument I should use. I expect the regularity of the variable coefficient $a(x)$ must play some role (if $a(x) \equiv 1$, then $A$ may be defined more readily using the Fourier transform, at which point it becomes clearer that $A : H^2 \to H^1$ is surjective).