  The first part of this paper is devoted to the derivation of a technical
result, related to the stability of the solution of a reaction-diffusion
equation $u_t-\Delta u = f(x,u)$ on $(0,\infty)\times \mathbb{R}^N$, where the
initial datum $u(0,x)=u_0(x)$ is such that $\lim_{t\to +\infty} u(t,x)=W(x)$
for all $x$, with $W$ a steady state in $H^1(\mathbb{R}^N)$. We characterize
the perturbations $h$ such that, if $u^h$ is the solution associated with the
initial datum $u_0+h$, then, if $h$ is small enough in a sense, one has
$u^h(t,x)>W(x)$ (resp. $u(t,x)<W(x)$) for $t$ large. This condition depends on
the sign of $\int_{\mathbb{R}^N} h(x)p(0,x)dx$, where $p$ is an adjoint
solution, which satisfies a backward parabolic equation on $(0,\infty)$ and is
uniquely defined [7]. We then provide two applications of our result. We first
address an open problem stated in [8] when $N=1$ and $f$ is a bistable
nonlinearity independent of $x$. Namely, we compute the derivative of the
critical length $L^*(r)$ associated with the initial datum
$\mathbf{I}_{(-L-r,-r)\cup (r,L+r)}$, that is the length $L$ above (resp.
below) which $u(t,x)$ converges to $1$ (resp. $0$) as $t\to +\infty$. Lastly,
again when $N=1$ and $f$ is a bistable nonlinearity independent of $x$, we
prove the existence and characterize with a bathtub principle the initial datum
$\underline{u}_0$ minimizing some cost function $\int_\mathbb{R} j(u_0)$ and
guaranteeing at the same time that $\liminf_{t\to +\infty} u(t,x)>0$ for all
$x$.
