Quadratic equations: Why does factoring by grouping work? We are learning factoring by grouping - The teacher explained the process but didn't explain  the logic behind it. You need to multiply the coefficient on the x-squared term by the constant to get a number.  You then need to find two numbers which multiply to this number, and add to the co-efficient on the x-term.  Then you split the x-term between these two numbers, group them, and factor them.  
Why does this work?
 A: Short answer:
You have to remember, grouping is simply splitting the middle term so that it can be grouped:
Take the expression $ 3x^2+10x+8 $
The terms have no common factors, but if you just split the middle term right:
$$3x^2+4x+6x+8$$
You can suddenly "group" the expression like such:
$$x(3x+4)+2(3x+4)$$
Woah - Magic! Now we have $(x+2)(3x+4)$!





Long answer:
Continuing off Gerry Myerson's answer:
Given the expression:
$ ax^2+bx+c $
You could rewrite it as such:
$(dx+e)(fx+g)$
Which proves the following is true (multiply it out):
$$ ax^2+bx+c=dfx^2+(dg+ef)x+eg $$
What you want to do first is to find $dg$ and $ef$. Since you already know that $df = a$, and $eg =c$, all you have to do is factor $dfeg$, or $ac$, into $dg$ and $ef$ (remember, $dg+ef=b$). Once you have found $dg$ and $ef$, you can rewrite the expression as such:
$$dfx^2+dgx+efx+eg $$
Now, you can "group" the equation into two factorable terms like so:
$$dfx^2+dgx = dx(fx+g)$$$$ efx+eg=e(fx+g)$$
Yay! Now your expression is simply:
$$dx(fx+g)+e(fx+g)$$$$=(dx+e)(fx+g)$$
A: So, you're given $ax^2+bx+c$, and you want to find $d,e,f,g$ such that $$ax^2+bx+c=(dx+e)(fx+g)$$ Multiply out the right side, and what we want is $$a=df,\quad b=dg+ef,\quad c=eg$$ The first step in the process gets you the number $ac$, which is $dfeg$. So you are trying to split  $dfeg$ into two factors that add up to $dg+ef$. Those two factors are going to be $dg$ and $ef$. I'm not sure what you mean by "group them", but you factor them as $d\times g$ and $e\times f$, and then you have the numbers $d,e,f,g$ that you're looking for. 
A: The grouping technique you are referring to is the "reverse" of the distribution property. 
Recall that the distribution property is as follows:
$$a(x+y)=ax+ay.$$ we may make use of this the following way as well:
$$(a+b)(x+y)=(a+b)x+(a+b)y,$$
Where we have treated (a+b) as one number, namely the sum.
Now it's only a matter of reversing this. Consider the following example:
$$x^2+5x+6.$$
To do this we find two numbers that add up to 5 and multiply to be 6. Those numbers are 2 and 3. So we have:
\begin{align*}
x^2+5x+6&=x^2+2x+3x+6\\
&=x(x+2)+3(x+2),
\end{align*}
which, from above, we recognize to be $$(x+3)(x+2).$$
