Bishop derivation completing the square in variational inference I don't understand the derivation on page 467. Bishop says:
Given the optimal factor $q_1^*(z_1)$
\begin{equation}
ln~q_1(z_1) = -\frac{1}{2} z_1^2 \Lambda_{11} + z_1 \mu_1 \Lambda_{11} - z_1 \Lambda_{12}( \mathbb{E}[z_2] - \mu_2) + cst
\end{equation}
using the technique completing the square, we can identify the mean and precision of this gaussian, giving:
\begin{equation}
    q^*(z_1) = \mathcal{N}(z_1 \mid m_1, \Lambda_{11}^{-1})
\end{equation}
where
\begin{equation}
    m_1 = \mu_1 - \Lambda_{11}^{-1} \Lambda_{12}( \mathbb{E}[z_2] - \mu_2)
\end{equation}
I don't really understand this method completing the square in this situation and how he got $m_1$
 A: A univariate Gaussian/Normal PDF has the following exponent term (calling $z_1$ as $x$ for notational simplicity): $$-(x-\mu)^2/2\sigma^2=-\frac{1}{2}x^2(\sigma^2)^{-1}+2x\mu(\sigma^2)^{-1}-\underbrace{\mu^2(\sigma^2)^{-1}}_{\text{constant}}$$
You just match terms:
$$-\frac{1}{2}x^2(\sigma^2)^{-1}=-\frac{1}{2}x^2\Lambda_{11}\rightarrow\sigma^2=\Lambda_{11}^{-1}$$
$$2x\mu\underbrace{(\sigma^2)^{-1}}_{\Lambda_{11}}=x (\mu_1 \Lambda_{11} - \Lambda_{12}( \mathbb{E}[z_2] - \mu_2))\rightarrow\mu=\mu_1-\Lambda_{11}^{-1}\Lambda_{12}(\mathbb{E}[z_2] - \mu_2))$$
Which are the mean and covariance of $z_1$. The situation is analogous when we think about multivariate gaussian, bu the example in Bishop assumes $z_1$ as univariate because you can't write $z_1^2$ otherwise. 
A: $$
\begin{align}
ln~q_1(z_1) &= -\frac{1}{2} z_1^2 \Lambda_{11} + z_1 \mu_1 \Lambda_{11} - z_1 \Lambda_{12}( \mathbb{E}[z_2] - \mu_2) + const. \\
    &= -\frac{1}{2} \Lambda_{11} \left(z_1^2 - 2\Lambda_{11}^{-1}z_1 \mu_1\Lambda_{11} + 2\Lambda_{11}^{-1}z_1\Lambda_{12}( \mathbb{E}[z_2] - \mu_2)\right) + const. \\
    &= -\frac{1}{2} \Lambda_{11} \left(z_1^2 - 2z_1(\mu_1 - \Lambda_{11}^{-1}\Lambda_{12}( \mathbb{E}[z_2] - \mu_2))\right) + const. \\
\end{align}
$$
now, let's say
$$
m_1 = \mu_1 - \Lambda_{11}^{-1}\Lambda_{12}( \mathbb{E}[z_2] - \mu_2)
$$
then we can rewrite previous equation in terms of $m_1$
$$
\begin{align}
ln~q_1(z_1) &= -\frac{1}{2} \Lambda_{11} \left(z_1^2 - 2z_1m_1\right) + const. \\
&= -\frac{1}{2} \Lambda_{11} \left(z_1^2 - 2z_1m_1 + m_1^2 - m_1^2\right) + const. \\
&= -\frac{1}{2} \Lambda_{11} \left(z_1^2 - 2z_1m_1 + m_1^2\right) + \frac{1}{2} \Lambda_{11}m_1^2 + const. \\
&= -\frac{1}{2} \Lambda_{11} (z_1 - m_1)^2 + \frac{1}{2} \Lambda_{11}m_1^2 + const. \\
&= -\frac{1}{2} \Lambda_{11} (z_1 - m_1)^2 + const. \\
\end{align}
$$
Now you can see that $const.$ will be just a part of the normalisation constant of the gaussian distribution, $m_1$ is a mean of the gaussian and $\Lambda_{11}$ is a precision
