Find the equation of the sphere $ x^2+y^2+z^2-2x-4y+8z=15$ I'm not sure how you get from this:
$x^2+y^2+z^2-2x-4y+8z=15$
To:
$(x^2-2x+1) + (y^2-4y+4) + (z^2+8z+16)-1-4-16=15$
How do you get the $1,4,16$?

It's grouping like terms and completing the square. For example, if you collect the terms in $x$ you have $x^2 - 2x$, so you want a constant term that will make that a perfect square. Since $(x-1)^2 = x^2 - 2x + 1$, you need a $1$. Similarly for the other two.
In general, if you have $ax^2 + bx$, to complete the square you need to add a constant term of $b^2/4a$, which makes the entire thing equal to $(\sqrt(a) x + \frac{b}{2\sqrt{a}})^2$. You can easily verify this by multiplying it out.
Here, in the first case, you have $a=1, b=-2$, so your constant term is $(-2)^2/(4*1) = 1$.
Similarly, in the second case $a=1,b=-4$, so your constant term is $(-4)^2/(4*1) = 4$.
In the third case, $a=1,b=8$, so your constant term is $8^2/(4*1) = 16$.
Once you've completed the squares, you can simplify the equation to
$$(x-1)^2 + (y-2)^2 + (z+4)^2 = 36,$$
which is much neater and more informative than the original form--you can immediately read off the coordinates of the center of the sphere and its radius.
