The FOIL method
FOIL is the distributive property applied to two binomials. Multiply the First terms, the Outer terms, the Inner terms and the Last terms, then combine the like terms: (ax + b)(cx + d) = acx² + (ad + bc)x + bd.
Example: (2x + 3)(x − 4). First 2x·x = 2x², Outer 2x·(−4) = −8x, Inner 3·x = 3x, Last 3·(−4) = −12. Combined, that is 2x² − 5x − 12.
Difference of two squares
A²x² − B² factors as (Ax + B)(Ax − B). When you FOIL the factors back out, the outer and inner terms cancel. Example: 9x² − 25 = (3x + 5)(3x − 5), and FOIL gives 9x² − 15x + 15x − 25 = 9x² − 25.
If P or Q is not a perfect square, the factors contain square roots, for example 5x² − 4 = (√5x + 2)(√5x − 2). Over the integers, such an expression does not factor.