Solution (source code)

= Solution

A confined <ground state> requires $k>0$; take $\alpha>0$ so the trial <wavefunction> is normalizable. Its normalized form is
$$
f_\alpha(x)=\left(\frac\alpha\pi\right)^{1/4}e^{-\alpha x^2/2}.
$$
The <Gaussian moment recurrence> gives $\langle x^2\rangle=1/(2\alpha)$ and $\langle x^4\rangle=3/(4\alpha^2)$. Also, <integration by parts> gives $\langle p^2\rangle=\hbar^2\int|f_\alpha'|^2dx=\hbar^2\alpha/2$. The <Rayleigh quotient> for the <quartic oscillator> is consequently
$$
\mathcal E(\alpha)=\frac{\hbar^2\alpha}{4m}+\frac{3k}{4\alpha^2}.
$$
Differentiation yields $\mathcal E'(\alpha)=\hbar^2/(4m)-3k/(2\alpha^3)$, so the unique minimum is at $\alpha_*=(6mk/\hbar^2)^{1/3}$. Since the quotient diverges at both endpoints $0$ and $\infty$, this is the global minimum in the trial family. The <Rayleigh-Ritz variational principle> gives
$$
\boxed{E_0\leq\mathcal E(\alpha_*)
=\frac{3\hbar^2}{8m}\left(\frac{6mk}{\hbar^2}\right)^{1/3}.}
$$
For the first excited <energy eigenstate>, choose the odd trial family
$$
\boxed{g_\beta(x)=\left(\frac{4\beta^3}{\pi}\right)^{1/4}x e^{-\beta x^2/2},\qquad\beta>0.}
$$
The even confining potential has an even, nodeless <ground state>, by the <nodeless theorem for a one-dimensional ground state>. By the <Sturm oscillation theorem>, its first excited state is odd with one node. The proposed family has the same <parity operator> eigenvalue and one node, and is orthogonal to the exact ground state, not merely to its Gaussian trial approximation. Minimization in the odd <linear subspace> therefore bounds the first excited energy from above. For completeness, its <Rayleigh quotient> is $3\hbar^2\beta/(4m)+15k/(4\beta^2)$, minimized at $\beta^3=10mk/\hbar^2$, giving $E_1\leq(9\hbar^2/8m)(10mk/\hbar^2)^{1/3}$. These are <Gaussian variational bounds for a quartic oscillator>.

If $k=0$, there is no normalizable <free particle> ground state on the whole line, though the spectral infimum is zero. If $k<0$, the <Hamiltonian operator> is not bounded below, so a ground-energy bound of the requested kind does not exist.