To factor this fraction, you have be be aware of two special factoring formula:
a^3 + b^3 = (a + b)(a^2 – ab + b^2)
(a+b)³ = a³ + 3a²b + 3ab² + b³
You can see the top part in this case is (x+y)^3, and the bottom (denominator) can be factor into (x+y)(x^2-xy+y^2)
we can cancel (x+y), so what we have left is (x+y)^2/(x^2-xy+y^2)
or (x^2+2xy+y^2)/(x^2-xy+y^2)