Using LaTeX in wordpress

I am a huge fan of \LaTeX, which is a document preparation system. While it does have a steep learning curve, it has a number of advantages over word processors, one of which is typesetting of mathematical symbols. And now this feature is also available for blog people such as myself, thanks to a delightful plugin called ‘WP QuickLaTeX’.

I would like to illustrate its use by demonstrating the solution to a puzzle I encountered recently. The puzzle is stated as follows:

 “Four years ago, Jane was twice as old as Sam. Four years on from now, Sam will be 3/4 of Jane’s age. How old is Jane now?”

The key to its solution is to recognize that it’s a linear algebraic problem involving a set of simple linear equations. Let Jane’s age be equal to x and let Sam’s age be equal to y. Now the sentence can be rephrased as follows:

“Four years ago, x = 2y. Four years from now on, y = \tfrac{3}{4}x. What is the value of x now?”

Now we are getting somewhere. But these equations are still incomplete, because they do not yet take into account that the statements are only true four years in the past or four years into the future. So let’s travel in time by adding or subtracting 4 from x and y in the equations.

(1)   \begin{align*} x-4 &= 2(y-4) \\ \tfrac{3}{4}(y+4) &= x + 4 \end{align*}

That’s better. We are almost there now. But first the equations must be put into standard form, i.e. ax + by = c. Like this:

(2)   \begin{align*} x - 2y &= -4 \\ \tfrac{3}{4}x - y &= 1 \end{align*}

Now finding the solution by elimination of variables is the most straightforward way to proceed, although the row reduction method would also work just as wel. We simply multiply one of the equations by some scalar such that the variable we are not interested in (y) cancels out and we are left with an equation with only the unknown variable for which we want to find a solution (x). You could for example multiply \tfrac{3}{4}x - y = 1 by -2 to obtain the form -1\tfrac{1}{2}x + 2y = -2. And now we can eliminate the y variable, like so:

(3)   \begin{alignat*}{5} x  &&- 2y &&= -4 && &&\\ -1\tfrac{1}{2}x &&+ 2y &&= -2 && && \\ \cline{0-4} -\tfrac{1}{2}x  && &&= -6 && && && \end{alignat*}


Finally, we are left with an equation that is trivial to solve: x = \dfrac{-6}{-\frac{1}{2}}, thus x = 12 and we are left with the conclusion that Jane must be twelve years old.

I don’t know if I will use this \LaTeX plugin more often, but it’s nice to know it’s there should I need it ;).

Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *