In 1977, famed computer scientist Donald Knuth decided he didn’t like the typesetting of the second edition of The Art of Computer Programming. Rather than unhappily accept the results of photographic typesetting techniques, Knuth invented his own digital typesetting solution, TeX, which would eventually become the standard typesetting system for mathematical and academic content. Wikipedia displays math content using a variant of TeX, and research papers from a large range of fields are very commonly submitted in TeX format.

Our team recently added the ability to understand TeX notation and convert it to the Mathematica form used by the powerful Wolfram|Alpha engine. We’ve received many requests for this functionality from people who use Wolfram|Alpha for advanced math and physics. It’s often easy and natural to write mathematics using TeX, whereas it can otherwise be quite difficult to express clearly in plaintext notation.

int sin{x^2}+sqrt{x} dx

The beauty of this new capability is that one can now see, compute, and understand typeset mathematics all through the union of TeX notation and Wolfram|Alpha computation. Complicated expressions are now easily represented using the elegance of TeX:
new-image1

You can use it with full-fledged TeX notation, for example, to get a sense of Gauss’ famous formula for the sum of the first n integers:

sum_{k=1}^n k

Or just incorporate parts to help write characters that are not so easy to represent, and, for instance, check that the square root of two really is irrational:

is the sqrt{2} in the rationals?

While this new functionality is definitely not a reimplementation of TeX (e.g., programming constructs like “def” et al. aren’t supported), it should allow math-like things to work. And when in doubt, use braces.

If you find other interesting things to fix or add, please let us know in the comment box below, but we can’t promise that we’ll send you a reward check!

This post was written by Buddy Ritchie and Greg Thole.

26 Comments

This is such a great addition. Great work.

Posted by Michael September 30, 2010 at 10:11 pm Reply

Add the ability to output to Tex!

Posted by Alec September 30, 2010 at 10:15 pm Reply

    Yes please!

    Posted by reg.doug October 4, 2010 at 10:44 am Reply

    Yes that would be very helpful indeed.

    Posted by Max October 6, 2010 at 7:48 am Reply

    great idea!

    Posted by newton October 11, 2010 at 4:03 pm Reply

Thank you! This is my want.

Posted by Yuki Fujimura September 30, 2010 at 10:17 pm Reply

It’s been very hard to search on the internet for a specific formula or a particular pattern for math expressions, even Google is not doing very well on this issue now. I’ve been wondering maybe WolframAlpha can design a “math expression search engine” and search every webpage on the internet for that specific expression we want. Thanks.

Posted by John September 30, 2010 at 11:05 pm Reply

Excellent work. Much appreciated!

Posted by Chris Smith October 1, 2010 at 3:09 am Reply

Great for TeX programmers who is not famiiar w/ Mathematica syntax

Posted by The Technical Expert October 1, 2010 at 4:06 am Reply

TeX output would be great, and it’s already in Mathematica!!

Posted by Jorge October 1, 2010 at 4:52 am Reply

What Jorge said: TeX output!

Posted by Oscar C. October 1, 2010 at 2:46 pm Reply

Awesome…

Now can you please change the iPhone app so the “\” key is not hidden… it’s a pain to “quickly” type in a TeX eq. in the app :-(

Posted by Jesper Angelo October 1, 2010 at 5:02 pm Reply

This is very useful, specially for people typing in the TeX.
A lot more people would probably try to copy and paste existing TeX formulas (from papers, webpages, applications, etc), but there are some problems:

\int_a^b \! f(x)\,dx \,
(copied from Wikipedia) gets interpreted as f(x), because of the spaces \! and \,

\sum_limits{i=0}^n i
becomes just {i=0}^n i (but works fine without \limit)

Unnecessary braces also seem to trip Alpha:
\sum_{{i=0}}^n i
again fails to be interpreted as the sum of i from 0 to n.

If Alpha could be made to just ignore TeX commands (like \limits, or spaces) that are used to improve the way a formula looks but have no mathematical meaning, then cut and paste from existing sources could become really useful and popular.

Posted by Eduardo October 1, 2010 at 5:21 pm Reply

    I agree with this. W|A seems to trip on
    \cos\left(x ? \frac{3\pi}{4}\right)
    but not on
    \cos(x ? \frac{3\pi}{4})

    If it just interpreted \leftx \righty as x and y, it would be that much easier for us. But overall, great new feature.

    Posted by Jackson Scholl October 17, 2010 at 11:30 am Reply

Fantastic work. Built environment professionals have to refer to a lot of guides, which can be super painstaking. CIBSE for instance, gives numeric values for pretty much every thing in the built environment (pipe sizes, air exchange rates, u-values etc). Just mull over it and try to see how you could use your engine to stop people like me having to flip through hundreds of pages a week. Big love!

D

Posted by Dominic October 2, 2010 at 12:17 am Reply

Hi! This an excellent work. I had thought of that. Thanks.

Posted by John Ortiz October 2, 2010 at 3:19 pm Reply

Great addon, thanks.

Posted by kobak October 3, 2010 at 2:11 am Reply

Tex output would be great too

Posted by jivkjdf October 3, 2010 at 8:56 pm Reply

Excellent addition, especially for those who works a lot with LaTeX, thanks!.

Posted by Zero October 5, 2010 at 9:06 pm Reply

Thats just amazing!!!

Posted by Max October 6, 2010 at 7:46 am Reply

A great feature. Keep it going.

best,
R

Posted by Rethnakaran Pulikkoonattu October 6, 2010 at 12:24 pm Reply

Even better for people not familiar with TeX, would be an interface like the one provided in Mathcad where you write your expression exactly as you would write them on a piece of paper: You would just use the integral or the Sum symbol as inputs ( no possible error due to the translation from the math expression to the TeX expression, and so much better…)

Posted by Sylvain Flamant October 7, 2010 at 5:18 pm Reply

Thank you! I was one of the folks who requested this functionality. Now I can typeset and evaluate equations in one pass. Absolutely wonderful.

Here’s a suggestion: add a “typset” or “save as” button that will give us the ability to save our equation in .pdf vector graphic format or high-res .jpeg. Then we could use Wolfram to quickly easily produce eqations for emails, papers, etc.

Posted by Paul October 7, 2010 at 10:24 pm Reply

Thanks for that excellent work, a TeX output also wouldn’t hurt, does it?

Posted by Andre November 25, 2011 at 12:19 pm Reply

TeX output please?

Posted by Alexander W. Janssen April 2, 2014 at 7:22 am Reply
Leave a Comment

(required)

(will not be published) (required)

(your comment will be held for moderation)