This is a formula for chemistry, but I'm having trouble figuring out out it was rearranged. I'd love any help/steps/explanations on how this was rearranged!

This is the first line:

$\displaystyle =\frac{h^2(n+1)^2\pi^2}{2mL^2}-\frac{h^2n^2\pi^2}{2mL^2}$

It was then manipulated to this:

$\displaystyle =(\frac{h^2\pi^2}{2mL^2})((n+1)^2-n^2)$

I'd appreciate any help!