How do I complete this square?

I need to simplify the following equation, by completing the square: $$\frac{\left(x-z\right)^{2}}{2(u-s)}+\frac{(z-y)^{2}}{2(t-u)}$$

As $\displaystyle\frac{\left(x-y\right)^{2}}{2(t-s)}+C$.

How can I do this? I can't seem to be able to deal with the fractions effectively when completing this square...

• There is no need to add evaluations like your parenthetical remark to question titles... – Mariano Suárez-Álvarez Feb 14 '11 at 3:30
• I'm sorry... I'm new to Stack Exchange. – squ1d Feb 14 '11 at 3:31
• @squid: If I am not wrong you are trying to do something with the normal distribution, you do not need to actually complete the square and work out the integrals and stuff. All you need to recognize is that you can add the expectation and variance of these independent normal random variables. – user17762 Feb 14 '11 at 3:40
• Yes Sivaram - that is correct. And I would have done that, but the professor has explicitly said to calculate it by direct integration - to my demise. I basically end up with two lines of a letter-salad and can't get anywhere. By the way, I don't have to turn this in since it was due last week, but it is annoying the hell out of me. – squ1d Feb 14 '11 at 3:42

The only way to have $$\frac{\left(x-z\right)^{2}}{2(u-s)}+\frac{(z-y)^{2}}{2(t-u)}$$ equal to $$\frac{\left(x-y\right)^{2}}{2(t-s)}+C$$ is to let $$C=\frac{(-s y+s z+t x-t z-u x+u y)^2}{2 (s-t) (s-u) (t-u)}.$$ I'm not sure this is completing a square, though.
For extra fun, the numerator in $C$ is exactly $$\left|\begin{array}{ccc}1&1&1\\s&t&u\\x&y&z\end{array}\right|^2,$$ while the denominator is $$-2\left|\begin{array}{ccc}1&1&1\\s&t&u\\s^2&t^2&u^2\end{array}\right|.$$