Simplest Schrödinger equation with both continuous and residual spectrum Consider a Schrödinger equation:
$$-\frac{\text{d}^2}{\text{d}x^2}f(x)+U(x)f(x)=Ef(x),$$
I need a $U(x)$ satisfying the following:


*

*The Schrödinger equation with it must be solvable purely analytically, without need for any numerics (but using special functions, integrals or series is acceptable — the main point is that they must be explicit, not yet another equation to solve)

*$\displaystyle \lim_{x\to\infty} U(\pm x)=0$

*$\exists a,b: U(x)<0\;\forall x\in[a,b]$


I.e. $U(x)$ should represent some potential well, which would have both free and bound states.
Boundary conditions are imposed at some points $q$, $r$. Changing locations of these points shouldn't affect analytical solvability of the BVP.
Are there any such $U(x)$? If yes, what are examples?
Examples of what does not answer the question are:


*

*finite square potential well, because to solve it one has to solve transcendental equations, which need numerics

*$\delta$-shaped potential well, since despite it can be solved analytically for infinite space, it still results in transcendental equation when $x\in[q,r]$

 A: Although one can't solve a problem of finite square well in closed form, it's still possible to give an explicit expression for the solution in terms of series or integrals. First, the solution in terms of series for the problem in infinite space is given in R Blümel 2005 J. Phys. A: Math. Gen. 38 L673.
Here I'll present my solution in terms of integrals for the case when boundary conditions are set symmetrically at $x=\pm b$ and the potential well's steps are at $x=\pm a$, $a<b$. For details of derivation, see this page (press "Download PDF" in the bottom right corner to get a readable local version). Here I'll only list the results.
So, here's the potential:
$$U(x)=\begin{cases}
+\infty & |x|>b,\\
U_0 & a\le|x|\le b,\\
0 & |x|<a,
\end{cases}$$
where $U_0>0$, $a>0$, $b>a$. I'll use the following variables (with $k_I$ being "wavevector" in space where $|x|<a$):
$$\xi=k_I a,\;\gamma=\sqrt{U_0} a,\;\beta=\frac b a,\;z=\frac xa.$$
Wavefunctions in general form
Then the wavefunction for odd parity states for $x\ge0$ will be
$$\begin{align}
\psi_I(z)&=\sin\xi z,\\
\psi_{II}(z)&=\frac{\sin\xi}{\sin\left(\sqrt{\xi^2-\gamma^2}(\beta-1)\right)}\sin\left(\sqrt{\xi^2-\gamma^2}\left(\beta-z\right)\right).
\end{align}$$
For even parity states, it takes this form for $x\ge0$:
$$\begin{aligned}
\psi_I(z)&=\cos\xi z,\\
\psi_{II}(z)&=\frac{\cos\xi}{\sin\left(\sqrt{\xi^2-\gamma^2}(\beta-1)\right)}\sin\left(\sqrt{\xi^2-\gamma^2}\left(\beta-z\right)\right).
\end{aligned}$$
For $x<0$ this should be reflected according to the parity of state (i.e. even state wavefunctions obey $\psi(-x)=\psi(x)$, odd ones $\psi(-x)=-\psi(x)$).
The spectral equation for $\xi$ will take the form
$$f^\pm(\xi)=0,$$
where
$$\newcommand{\sinc}{\operatorname{sinc}}
\newcommand{\floor}[1]{\lfloor#1\rfloor}
\newcommand{\ceil}[1]{\lceil#1\rceil}
\newcommand{\hfloor}[1]{\left\lfloor#1\right\rfloor}
\newcommand{\hceil}[1]{\left\lceil#1\right\rceil}
f^-(\xi)=(\beta-1)\sinc\left((\beta-1)\sqrt{\xi^2-\gamma^2}\right)\cos\xi+\cos\left((\beta-1)\sqrt{\xi^2-\gamma^2}\right)\sinc\xi$$
for odd parity states, and
$$f^+(\xi)=(\beta-1)\xi\sinc\left((\beta-1)\sqrt{\xi^2-\gamma^2}\right)\sin\xi-\cos\left((\beta-1)\sqrt{\xi^2-\gamma^2}\right)\cos\xi$$
for even parity states.
Root separators
Now we'll find root separators for even and odd parity states.
Odd case
Define 
$$\xi^-_a(m)=\begin{cases}
\frac{-\pi m+(\beta-1)\sqrt{(\beta-2)\beta\gamma^2+\pi^2m^2}}{\beta(\beta-2)}&\mathrm{if}\;\;\pi m\ge\gamma\\
\pi m&\mathrm{otherwise}
\end{cases},$$
$$\begin{align}
m^-_{1c}(m)&=\hceil{\frac{\xi^-_a(m)}{\pi}},\\
m^-_{2c}(m)&=\hceil{\Re\left\{\frac{\beta-1}\pi\sqrt{(\xi^-_a(m))^2-\gamma^2}\right\}},
\end{align}$$
$$\begin{align}
\xi^-_{1c}(m)&=\pi m^-_{1c}(m)\\
\xi^-_{2c}(m)&=\sqrt{\left(\frac{\pi m^-_{2c}(m)}{\beta-1}\right)^2+\gamma^2},
\end{align}$$
Now this is the root separator for the odd case
$$\xi^-(m)=\min(\xi^-_{1c}(m),\xi^-_{2c}(m)),$$
where $m=0,1,2,...$.
Even case
Define
$$\xi^+_a(m)=\begin{cases}
\frac{-\pi(2m+1)+(\beta-1)\sqrt{4(\beta-2)\beta\gamma^2+\pi^2(2m+1)^2}}{2(\beta-2)\beta}&\mathrm{if}\;\;\pi m+\frac\pi2\ge\gamma\\
\pi m+\frac\pi2&\mathrm{otherwise}
\end{cases}$$
$$\begin{align}
m^+_{1c}(m)&=\hceil{\frac{\xi^+_a}\pi-\frac12},\\
m^+_{2c}(m)&=\hceil{\Re\left\{\frac{\beta-1}\pi\sqrt{(\xi^+_a)^2-\gamma^2}\right\}},
\end{align}$$
$$\begin{align}
\xi^+_{1c}(m)&=\frac\pi2+\pi m^+_{1c},\\
\xi^+_{2c}(m)&=\sqrt{\left(\frac{\pi m^+_{2c}}{\beta-1}\right)^2+\gamma^2}.
\end{align}$$
The root separator in the even case will be
$$\xi^+(m)=\begin{cases}0&\mathrm{if}\;\;n=-1\\
\min(\xi^+_{1c}(m),\xi^+_{2c}(m))&\mathrm{otherwise},
\end{cases}$$
where $m=-1,0,1,2,...$.
Locating the roots of spectral equations
If we define
$$R=\frac{B-A}2,$$
$$h=\frac{A+B}2,$$
$$z(\varphi)=Re^{i\varphi}+h,$$
where $A$ and $B$ are $m$th and $(m+1)$th root separators, then the root can be found using
$$\xi'=h+R\left[\frac
{\displaystyle\int_0^{2\pi} w(\varphi)e^{2i\varphi}d\varphi}
{\displaystyle\int_0^{2\pi} w(\varphi)e^{i\varphi}d\varphi}\right],$$
where $w(\varphi)=1/f^\pm(z(\varphi))$.
Summary of computation procedure
Given the number $n$ of the state we want to compute wavefunction for, we do the following:


*

*Select $\xi^+$ for odd $n$ or $\xi^-$ for even $n$, use all the expressions of odd parity states for even $n$ and even parity for odd $n$

*Compute root separators $A=\xi^\pm(\floor{n/2}-1)$ and $b=\xi^\pm(\floor{n/2})$

*Compute the root $\xi'$ of spectral equation

*Substitute the root of spectral equation into expression for wavefunction

*Optionally normalize the wavefunction
