<s>[INST] Factorising quadratics - coefficient of $x^2$ is greater than $1$ In factoring quadratics where the coefficient of $x^2$ is greater than $1$, I use the grouping method where we multiply the coefficient and constant together and then factor.
My question is can someone explain the math behind that?
Example:
$5x^2+11x+2,\quad  5\cdot2=10$
$5x^2+10x+x+2$
$5x(x+2)+1(x+2)$
$(5x+1)(x+2)$
 [/INST] Sometimes, instead of using symbols, it can help to just use numbers to keep track of patterns (and then generalize with symbols later).
To understand this grouping method, it is instructive to work the problem backwards, and to expand, instead of factor.
For example
$$(2x+3)(5x+7)\text{ the constants are all distinct primes. How fortunate.}$$
$$2\cdot5x^2 + 2\cdot7x+3\cdot5x+3\cdot7$$
$$\color{green}{2\cdot5}x^2 + (\color{blue}{2\cdot7}+\color{blue}{3\cdot5})x+\color{green}{3\cdot7}$$
Notice how we can partition the middle coefficient ($2\cdot7+3\cdot5$) into $2\cdot7$ and $3\cdot5$. The product of these partitions is $(2\cdot7)(3\cdot5)=2\cdot3\cdot5\cdot7$, which is equal to the product of the outside cofficients $(2\cdot5)(3\cdot7)=2\cdot3\cdot5\cdot7$.
In a real problem, however, we don't know the components (2, 3, 5, and 7). We only know the coefficients 10, 29, and 21 for the quadratic $$10x^2+29x+21$$
Our first step is to partition the middle coefficient into two parts such that the sum of the parts is $29$ and the product is $10\cdot21=210$. After analyzing the factors of $210$, we settle on the partitions  $14$ and $15$.
Looking above at the quadratic with the colored coefficients, notice that neither of the factors of the $x^2$ term appear in both partitions (2 is a factor of the first partition, and 5 is a factor of the second partition). The same property holds true for the target factors of the constant term (the 3 and 7 appear in different partitions). This property will allow us to factor by grouping, thus discovering numbers 2,3,5, and 7 from the numbers 10, 14, 15, 21.
$$(10x^2+14x)+(15x+21)=2x(5x+7)+3(5x+7)=(2x+3)(5x+7)$$
Also take note that it doesn't matter what partition we associate with the $10x^2$ term. We just get a different common factor, depending upon whether we choose $14x$ or $15x$.
$$(10x^2+15x)+(14x+21)=5x(2x+3)+7(2x+3)=(5x+7)(2x+3)$$
As an exercise, you may want to restate the preceding argument for the quadratic
$$(px+r)(qx+s)$$
</s>