I understand how factoring a quadratic $(ax^2 + bx +c)$ with "$a$" equal to one works. If it's in the form $(x+d)(x+e)$ then "$d$" and "$e$" are the only two terms that can multiply together to yield a term with no "$x$". And when "$d$" is multiplied by the 2nd "$x$", and "$e$" is multiplied by the first "$x$" and the like terms are added together they yield "$bx$". Thus, with this information we can get the factored form.
Question: How does the "trick" that math teachers teach us to factor quadratics with "$a$" not equal to 1 work? This is the trick where we figure out what multiplies to "$ac$" and what adds to "$bx$", then rewrite the quadratic in the form $ax^2 + dx + kx + c$ and factor from there.
Note: I've been using this trick for a long time, and this isn't my first time with quadratics, but this is a question that's been bugging me for a while. I'm sorry if the answer is glaringly simple. Thanks for your help.
For $a$ not equal to $1$, begin like this $$ a x^2 + bx + c = a \left(x^2 + \frac{b}{a} x + \frac{c}{a}\right) $$ then factor the part inside the parentheses using the method of $a=1$.
Example $$ 5x^2-7x+2 = 5\left(x^2 - \frac{7}{5}x + \frac{2}{5}\right) =5\left(x-1\right)\left(x-\frac{2}{5}\right) $$