Given a linear time-invariant system:
$$ \dot{x}(t)=Ax(t)+Bu(t) $$
with initial state $ x(0)=x_0 $ and final state $ x(T)=x_T $.
Let's take the following matrix and controller:
$$ A=\begin{bmatrix} -1 & 0.5 \\ 0.3 & -1 \end{bmatrix}, B=\begin{bmatrix} 1\\ 1 \end{bmatrix} $$
and let the initial state be $ x_0=\begin{bmatrix} 1 \\ 0 \end{bmatrix} $ and the final state be $ x_T=\begin{bmatrix} 0 \\ 1 \end{bmatrix} $.
How to find the control signal and the control energy for an arbitrarily chosen (not necessarily optimal) trajectory that connects the inital and final state $ \lambda(t) $?
A biological example would be to move an arm between two points, which can be any continuous movement.
One can only find the control signal if the provided trajectory is feasible. Namely in order to satisfy the differential equation the terms which are not a function of $u(t)$ still need to lie inside the span of $B$. Since
$$ \dot{\lambda}(t) - A\,\lambda(t) = B\,u(t) $$
so in order to solve for $u(t)$ the left hand side needs to be a multiple of $B$.
For example it can be shown that linear interpolation of the example system is not feasible
$$ \lambda(t) = \begin{bmatrix}1 \\ 0\end{bmatrix} \left(1 - \frac{t}{T}\right) + \begin{bmatrix}0 \\ 1\end{bmatrix} \frac{t}{T} $$
$$ \dot{\lambda}(t) = \begin{bmatrix}-1 \\ 1\end{bmatrix} \frac{1}{T} $$
$$ \dot{\lambda}(t) - A\,\lambda(t) = \begin{bmatrix} 1 - \frac{1}{T} \\ \frac{1}{T} - \frac{3}{10} \end{bmatrix} + \begin{bmatrix} - \frac{3}{2} \\ \frac{13}{10} \end{bmatrix} \frac{t}{T} $$
namely the constant term only lies in the span of $B$ for one specific value of $T$ (namely $T=\frac{20}{13}$), however the time varying term never lies in the span of $B$ except at $t=0$. So on the interval $0<t<T$ the expression $\dot{\lambda}(t) - A\,\lambda(t)$ does not always lie in the span of $B$ and is therefore not feasible.
If $\lambda(t)$ is feasible you could use the left inverse of $B$ if $B$ does not have a rank of $n$ (where $A\in\mathbb{R}^{n\times n}$) to find $u(t)$
$$ u(t) = \left(B^\top B\right)^{-1} B^\top \left(\dot{\lambda}(t) - A\,\lambda(t)\right). $$
If $B$ does have a rank of $n$ then the normal inverse can be used and also any $\lambda(t)$ should be feasible, since $B$ would then span the whole $\mathbb{R}^n$
$$ u(t) = B^{-1} \left(\dot{\lambda}(t) - A\,\lambda(t)\right). $$