In a Khan Academy course there was a problem that required factoring. They gave the answer but they skipped a step as to how this part was factored.
$$x^4-x^2 = x^2(x+1)(x-1)$$
I don't understand where the $+1$ and $-1$ came from and nothing makes sense except for me partly being able to see $x^2$ was factored out. I also put the left side of it in an online equation calculator and it jumped straight to the part on the right. I'm not understanding how you get one from the other.
You can write $$x^4-x^2=x^2(x^2-1)=x^2(x+1)(x-1)$$ where the second is the difference of two squares.