Kinky Adventures in LaTeX Land: The Sum and Product of Roots of a Quadratic Equation

?????????🐒🐶🐱🐳🐿🐥?????????

\equiv \newline

\pi r^2 
\equiv \newline \pi r^2

?????????🙈😬🙄😮?????????

One of the things I don’t like about blogging is how long it can take to put together a blog post, even after it has been written, edited and polished. Aside from all the formatting required to make an entry look the way I want (see above), the other big time-suck has been adding mathematical statements (equations, formulas, expressions, etc.) to my blog. While I love MathType for its ease-of-use, using it has meant I’ve had to suffer through 1) writing math statements in the MathType Editor, 2) inserting them into a Pages document, 3) copying the said insertion into Preview, 4) exporting the Preview file as a PNG,  5) uploading the PNG to WordPress, and, finally, 6) inserting the PNG into the appropriate blog post. This is a lot of steps for something as short as, say, the area of circle (again, see above).

As such, I was happy when, several weeks ago, I stumbled onto MathJax, a Javascript engine which renders  LaTeX  “code” into professional-looking math statements. I had, for a long time, known about TeX and LaTeX as way to create math documents, but had always been satisfied with MathType to get done what I needed done. After doing a bit more investigation and discovering that WordPress already supported LaTeX,  I decided to give it a shot by using a LaTeX snippet I found here and expanding it into an entry on the sum and product of quadratic roots below.

***

Given a quadratic equation in general form ax^2 + bx + c = 0, the equation’s roots are

x = {-b \pm \sqrt{b^2-4ac} \over 2a}.\newline \newline

or

x_1 = {-b + \sqrt{b^2-4ac} \over 2a}\newline \newline x_2 = {-b - \sqrt{b^2-4ac} \over 2a}\newline \newline

Let

\Delta = b^2-4ac

Thus, the product of roots

x_1x_2 \newline \newline

equals

= ({-b + \sqrt{\Delta} \over 2a})({-b - \sqrt{\Delta} \over 2a})\newline \newline = {b^2 - \Delta \over 4a^2}\newline \newline = {b^2 - (b^2-4ac) \over 4a^2}\newline \newline = {4ac \over 4a^2} \newline \newline = {c \over a} \newline \newline

And the sum of roots

x_1 + x_2 \newline \newline

equals

= {-b + \sqrt{\Delta} \over 2a}+{-b - \sqrt{\Delta} \over 2a}\newline \newline = {\frac{-2b}{2a}}\newline \newline = {-\frac{b}{a}} \newline \newline

For example,

2x^2 +7x + 6 = 0 \newline \newline 2x^2 + 3x + 4x + 6 = 0\newline \newline x(2x +3) +2(2x+3) = 0\newline \newline (2x +3)(x+2) = 0\newline \newline

So,

x_1 = -1.5, x_2 =-2\newline \newline

Given

a = 2, b = 7, c = 6\newline \newline

Product of roots

{c \over a} = {6 \over 2} = x_1x_2 = (-1.5)(-2) = 3\newline \newline

Sum of roots

{-\frac{b}{a}} = {-\frac{7}{2}} = x_1 + x_2 = -1.5 + -2 = -3.5

***

Given LaTeX has a bit of a learning  curve, I probably didn’t finish this entry any faster with it than if I had used MathType. And I ran into some kinks (e.g. why do some numbers/variables look smaller than others despite having set everything to the same size?). Nonetheless, LaTeX was fun to learn and I hope to get better at it with practice. Another arrow in the quiver, so to speak.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s