This is a part of a larger proof, which is irrelevant here. What I'm stuck on is showing that this:

k*(u0-u)^2+n*(y-u)^2

is the same as

(k*n/(k+n))*(y-u0)^2+(k+n)*((k*u0+n*y)/(k+n)-u)^2

Note that u0 and u are two different variables.

I've been factoring and pushing things around for more than 2 hours. I'm embarrassed to be stuck