Matrix minimization Optimization When I study the output-based optimal control problem, I meet such a optimization problem as 
$\min\limits_{K\in \mathbb{R}^{s\times m}} x^TC^T K^T RKCx+x^TBKCx+x^TC^TK^TB^Tx$
where $x\in \mathbb{R}^n$ can be any vector and $R\in \mathbb{R}^{s\times s}$ is a definite-positive matrix. Moreover, $C\in \mathbb{R}^{m\times n}$ and $B\in \mathbb{R}^{n\times s}$.
In fact, I want to find a matrix $K$ such that  $ C^T K^T RKC+BKC+C^TK^TB^T$ is minimized.
 A: Since $R$ is positive definite, there exists a full rank $L\in \mathbb R^{s\times s}$ such that $L^T R L = I$ (see Cholesky decomposition). Since the linear transformation defined by $L$ is bijective, we can rewrite your minimization problem through the $L$ transformation :
\begin{align*}
&\min\limits_{K\in \mathbb{R}^{s\times m}} x^TC^T K^T RKCx+x^TBKCx+x^TC^TK^TB^Tx\\
=&\min\limits_{K\in \mathbb{R}^{s\times m}} x^TC^T K^T KCx+x^TBLKCx+x^TC^TK^TL^TB^Tx\\
=&\bigg(\min\limits_{K\in \mathbb{R}^{s\times m}} x^TC^T K^T KCx+x^TBLKCx+x^TC^TK^TL^TB^Tx+x^T BLL^TB^Tx\bigg)-x^T BLL^TB^Tx\\
=&\bigg(\min\limits_{K\in \mathbb{R}^{s\times m}} x^T(KC+L^TB^T)^T(KC+L^TB^T) x \bigg)-x^T BLL^TB^Tx\\
=&\bigg(\min\limits_{K\in \mathbb{R}^{s\times m}} \left\lVert(KC+L^TB^T) x \right\rVert^2 \bigg)-x^T BLL^TB^Tx\\
=&\bigg(\min\limits_{K\in \mathbb{R}^{s\times m}} \left\lVert(KC+L^TB^T) x \right\rVert^2 \bigg)-x^T BR^{-1}B^Tx
\end{align*}
By observing that $RLL^T=L^{-T}L^T RLL^T = L^{-T} L^T = I$ so that $LL^T=R^{-1}$. To do the last minimization you can observe that if $K=-L^TB^T x(x^TC^TCx)^{-1} x^T C^T$, then 
\begin{align*}
(-v(x^TC^TCx)^{-1} x^T C^TC+L^TB^T) x &= -L^TB^T x(x^TC^TCx)^{-1} x^T C^TC x+L^TB^T x\\
&= 0
\end{align*}
which is clearly the minimizer since the quantity is positive, hence
\begin{align*}
\min\limits_{K\in \mathbb{R}^{s\times m}} x^TC^T K^T RKCx+x^TBKCx+x^TC^TK^TB^Tx = -x^T BR^{-1}B^Tx
\end{align*}

The optimal value for $K$ may seem a bit arbitrary but it actually follows from the Moore Pseudo inverse, suppose you are minimizing $\lVert Au+v\rVert$ with respect to $A$, then $u\neq 0$ can be as a full rank $k\times 1$ matrix with pseudo inverse $u^\dagger=(u^T u)^{-1}u^T$ and then it is known that the minimal value of the minimization problem is given by $-v u^\dagger$, which gives $-v u^\dagger u+v = -v(u^T u)^{-1}u^T u + v = 0$
