# Diamond method for factoring quadratics.

Show that if $ax^2+bx+c$ can be factored such that the factors have integer coefficients, then there exists integers $u$ and $v$ such that $u+v=b$ and $uv=ac$.

This problem regards the "diamond method" which was not covered in class. It is used to factor $ax^2+bx+c$. First we find integers $u,v$ such that $u+v=b$ and $uv=ac$. Then we factor $ax^2+ux+vx+c$ by grouping.

Suppose that $ax^2+bx+c$ can be factored such that the factors have integer coefficients, so $ax^2+bx+c = (mx+n)(px+q)$. Then we have

$$mp=a\;,\qquad nq=c\;,\qquad np+mq = b\;.$$

Multiplying the first two equations together to get $mpnq=ac$, and rearranging we see that

$$(np)(mq) = ac\;, \qquad (np)+(mq) = b\;.$$

So $np = u$ and $mq=v$ are the desired integers.

• How would you show the converse? That if $u$ and $v$ exist, the quadratic can be factored into factors with integer coefficients? – Chad Oct 11 '16 at 4:31
• If you start off supposing that such a $u$ and $v$ exists, then you can write you polynomial as $ax^2 +ux+vx+c$. Then rewrite this as $$x(ax+u)+(vx+c)$$. Since $uv=ac$ you can guarantee that $(ax+u)$ and $(vx+c)$ have a common linear factor. – Mike Pierce Oct 11 '16 at 15:30
• Can you explain that last line, please? Sorry. – Chad Oct 12 '16 at 1:09
• @Chad The idea is going to be that the common linear factor will look like $$(\gcd(a,v)x + \gcd(c,u))\;.$$ You can kinda see why this is by noting that if $p|a$ but $p\!\nmid\! v$, then we must have $p|u$ so we can factor out $p$ from $(ax+u)$. We can similarly factor things out of $(vx+c)$ until the coefficients are just the indicated $\gcd()$ values. – Mike Pierce Oct 12 '16 at 4:59

So we have that $p(x) = ax^2 + bx + c$ can be factored degree one polynomial integer coefficients so:

$$p(x) = (kx + p)(mx + q)$$

But,

$$kxmx = kmx^2 = ax^2 \implies a = km$$

Furthermore, $$pq = c$$

So say that $u = kq$ and $v = mp$. Then:

$$kxq + mxp = (kq + mp)x = bx \implies (u+v) = b$$
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://math.stackexchange.com/questions/1963269/diamond-method-for-factoring-quadratics", "fetch_time": 1568957715000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2019-39/segments/1568514573832.23/warc/CC-MAIN-20190920050858-20190920072858-00004.warc.gz", "warc_record_offset": 589949032, "warc_record_length": 31343, "token_count": 663, "char_count": 1984, "score": 4.4375, "int_score": 4, "crawl": "CC-MAIN-2019-39", "snapshot_type": "latest", "language": "en", "language_score": 0.8516716361045837, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00027-of-00064.parquet"}