You can put this solution on YOUR website! FOIL: First, Outer, Inner, Last
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(m^2+1)(m^4-m^2+1)
(1 + m^2)(1 + -1m^2 + m^4)
distribute the terms of the first equation over the second equation:
(1(1 + -1m2 + m4) + m2(1 + -1m2 + m4))
(1 + -1m^2 + 1m^4 + (1m^2 + -1m^4 + m^6))
Too messy. Reorder the terms and combine:
(1 + -1m^2 + 1m^2 + 1m^4 + -1m^4 + m^6)
(1 + 1m^4 + -1m^4 + m^6)
(1 + 0 + m^6)
1 + m^6
m^6 + 1 <-- this is your answer