(x-1)^2 - (x-5)^2 = (x-1-(x-5))*(x-1+(x-5))=(x-1-x+5)*(x-1+x-5)=4(2x+4)=8(x+2)

For the second one:

assume it equals zero, find the roots and use the fact that a quadratic equation equals: a(x-x1)(x-x2), a being the constant in front of x^2 and x1 and x2 the roots.