  We study the mean first passage time (MFPT) to an absorbing target of a
one-dimensional Brownian particle subject to an external potential $v(x)$ in a
finite domain. We focus on the cases in which the external potential is
confining, of the form $v(x)=k|x-x_0|^n/n$, and where the particle's initial
position coincides with $x_0$. We first consider a particle between an
absorbing target at $x=0$ and a reflective wall at $x=c$. At fixed $x_0$, we
show that when the target distance $c$ exceeds a critical value, there exists a
nonzero optimal stiffness $k_{\rm opt}$ that minimizes the MFPT to the target.
However, when $c$ lies below the critical value, the optimal stiffness $k_{\rm
opt}$ vanishes. Hence, for any value of $n$, the optimal potential stiffness
undergoes a continuous "freezing" transition as the domain size is varied. On
the other hand, when the reflective wall is replaced by a second absorbing
target, the freezing transition in $k_{\rm opt}$ becomes discontinuous. The
phase diagram in the $(x_0,n)$-plane then exhibits three dynamical phases and
metastability, with a "triple" point at $(x_0/c\simeq 0.17185$, $n\simeq
0.39539)$. For harmonic or higher order potentials $(n\ge 2)$, the MFPT always
increases with $k$ at small $k$, for any $x_0$ or domain size. These results
are contrasted with problems of diffusion under optimal resetting in bounded
domains.
