a^{2}-b^{2}=(a-b)*(a+b). You can check it by simply multiplying the first parentheses and the second ones. You will end up with a^{2}-ab+ab-b^{2}=a^{2}-b^{2}.

If a trinomial is a perfect square, it shall be of the form a^{2}±2ab+b^{2}. Then it is factored as (a±b)*(a±b).

As for the sum and difference of two cubes, the formulas are as follows: