The Wolfram|Alpha Blog is now part of the Wolfram Blog. Join us there for the latest on Wolfram|Alpha and other Wolfram offerings »
The Wolfram|Alpha Math Team

Talk to Wolfram|Alpha in TeX

September 30, 2010 —
Comments Off

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:

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.


This is such a great addition. Great work.

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

Add the ability to output to Tex!

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

    Yes please!

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

    Yes that would be very helpful indeed.

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

    great idea!

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

Thank you! This is my want.

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

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

Excellent work. Much appreciated!

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

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

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

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

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

What Jorge said: TeX output!

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


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

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

    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

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!


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

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

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

Great addon, thanks.

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

Tex output would be great too

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

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

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

Thats just amazing!!!

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

A great feature. Keep it going.


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

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

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

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

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

TeX output please?

Posted by Alexander W. Janssen April 2, 2014 at 7:22 am

I got the pro version but still can’t find how to download the results in tex.

Posted by adam November 1, 2014 at 1:44 pm

    Adam, you should be able to hover over a pod with math results, click on “Data download”, and then choose the appropriate format.

    Posted by The Wolfram Team November 6, 2014 at 2:25 pm

It would be great if Wolfram|Alpha understood \intop as \int (they are the same symbol).

Posted by Travis November 19, 2014 at 11:21 pm

This is super convenient as I can just paste what I am working on into WA and get my answers or check my work instantly.

The only issue I have found is that two binomial coefficients next to other don’t implicitly multiply as I would expect.

`\binom{a}{b}\binom{c}{d}` causes WA to throw a fit, you have to add the multplication explicitly as `
\binom{a}{b}*\binom{c}{d}`. It’s not a big issue but it is an annoying step when copy-pasting.

Posted by Kevin Cox March 10, 2015 at 3:57 pm

The wolfram alpha API does not seem to have this feature. How can I input a TeX equation via the wolfram alpha API??

Posted by Nico July 6, 2015 at 8:40 pm