Let $z$ be a complex number satisfying $12|z|^2=2|z+2|^2+|z^2+1|^2+31.$ What is the value of $z+\frac 6z?$
Using the fact $z\bar{z}=|z|^2$, the equation rewrites itself as \begin{align} 12z\bar{z}&=2(z+2)(\bar{z}+2)+(z^2+1)(\bar{z}^2+1)+31 \\ -12z\bar{z}+2z\bar{z}+4(z+\bar{z})+8+z^2\bar{z}^2+(z^2+\bar{z}^2)+32&=0 \\ \left((z^2+2z\bar{z}+\bar{z}^2)+4(z+\bar{z})+4\right)+\left(z^2\bar{z}^2-12z\bar{z}+36\right)&=0 \\ (z+\bar{z}+2)^2+(z\bar{z}-6)^2&=0. \end{align} As the two quantities in the parentheses are real, both quantities must equal $0$ so \[z+\frac6z=z+\bar{z}=\fbox{-2}.\]