How is (x^2+2x+4) derived from (x^3-8)? What do you call it's formula and what are the steps required to turn (x^3-8) into (x^2+2x+4)?

check your text. The way to factor the difference of two cubes is

(a^3 - b^3) = (a-b)(a^2+ab+b^2)

Here, you have

a=x
b=2

Simple as that.