Liouville's original criterion for elementary anti-derivatives states:
If $f,g$ are rational, nonconstant functions, then the antiderivative of $f(x)\exp{g(x)}$ can be expressed in terms of elementary functions if and only if there exists a rational function $h(x)$ such that $f=h'+hg'$.
Of particular note for my purpose is the fact that $f,g$ must be rational functions. Motivated by this recent question, I'm interested in the following weakening of Liouville's problem:
If $f,g$ are rational non-constant functions, under what conditions can the antiderivative of $\sqrt{f(x)}\exp{g(x)}$ be expressed in terms of elementary functions?
This presumably falls under the heading of the modern Liouville criterion, as expounded by Wikipedia here. (See also Bill Dubuqeu's short precis on the Liouville-Ritt theory of integration in finite terms here.) Alas, I don't know enough differential algebra to apply this productively, nor do I really have the patience to gain such expertise.
Motivated by a remark made in a (withdrawn) answer to the initial version of this question, however, one may come up a partial answer by assuming an antiderivative of the form $\sqrt{h(x)}\exp{g(x)}$. Differentiating, we obtain
$$\frac{d}{dx}\sqrt{h(x)}\exp{g(x)}=\left(g'(x)\sqrt{h(x)}+\frac{h'(x)}{2\sqrt{h(x)}}\right)\exp{g(x)}$$ Setting this equal to $\sqrt{f(x)}\exp g(x)$ and solving for $f(x)$, we conclude that $\sqrt{f(x)}\exp g(x)$ has an elementary antiderivative if there exists a rational function $h(x)$ such that $$f(x)=g'(x)^2h(x)+g'(x)h'(x)+\frac{h'(x)^2}{4h(x)}.$$
What this does not show, however, is that the condition above is necessary rather than sufficient.