Math on the Pololu website!

Posted by Paul on 27 June 2014


Tomorrow is Tau Day! To celebrate, I thought I should write something about how we use math on our website.

Mathematics is essential to engineering, so we often need to use math when presenting a product or discussing some point about robotics and electronics. In the past, we have struggled to come up with our own ways of getting math online, such as using HTML code (e.g. a 1×2 table with an internal border can look like a fraction) or finding some engineer here who knows how to type up equations in LaTeX and export images.

Over the past month, we have quietly switched to MathJax, which is the technology used on the very popular site MathOverflow. We are using MathJax, for example, to explain current and voltage settings for our new TPS2113A carrier and to show how to compute the exact gear ratios of some of our Micro Metal Gearmotors – the 1000:1 Micro Metal Gearmotor being a particularly good example since it has so many gears.

MathJax allows us to type math directly into web pages using simple text codes, and it uses modern features of your web browser to format the math for you as the page is loaded. If you reload this page and watch the equation below carefully, you will briefly see the raw code before MathJax redraws it:

``int_0^oo e^(-x^2) dx = sqrt pi / 2``

(The integral of a Gaussian has long been one of my favorite mathematical exercises.)

Try it yourself

Instead of using the LaTeX syntax used on MathOverflow, we chose a simpler input format called ASCIIMath. You can read documentation on the ASCIIMathML page. The way it works is that you type ASCIIMath code within double back-quotes, like this:

``int_0^oo e^(-x^2) dx = sqrt pi / 2``

We have enabled MathJax throughout the site, including blog comments, so that you can participate fully in discussions here, starting with this little Tau Day celebration. So, what is your favorite equation? Try out MathJax and share it with us in the comment section below!

2 comments

Ben wanted me to post the details of the Gaussian integral, so here we go.

It's simpler to think about the full integral from ``-oo`` to ``+oo``. Let's give that a name:

``lambda = int_-oo^oo e^(-x^2) dx``.

Then, instead of trying to compute ``lambda``, we work on ``lambda^2``:

``lambda^2 = ( int_-oo^oo e^(-x^2) dx )^2 = int_-oo^oo int_-oo^oo e^(-x^2) e^(-y^2) dx dy``.

We note that ``e^(-x^2) e^(-y^2) = e^(-(x^2+y^2))`` and rewrite in polar coordinates:

``lambda^2 = int_0^oo e^(-r^2) 2pi r \ dr``.

Luckily, that integral is easy, since ``d / (dr) pi e^(-r^2) = - 2 pi r \ e^(-r^2)``:

``lambda^2 = - [ pi e^(-r^2) ]_0^oo = pi``;

``lambda = sqrt(pi)``.

Finally, since the Gaussian is an even function, our desired integral is just half of that value:

``int_0^oo e^(-x^2) dx = sqrt pi / 2``.
Einstein Field Equation:
``G_(mu nu) + Lambda g_(mu nu) = (8 pi G)/c^4 T_(mu nu)``

Post a comment

Using your Pololu account allows you to customize your avatar and manage your comments; you can also post anonymously.

New Products

Zumo 2040 Robot Kit (No Motors)
3pi+ 2040 Control Board
Motoron M2U550 Dual Serial Motor Controller (Header Pins Soldered)
9V, 2.5A Step-Up/Step-Down Voltage Regulator S13V25F9
7.5V, 2.5A Step-Up/Step-Down Voltage Regulator S13V25F7
Motoron M3H550 Triple Motor Controller for Raspberry Pi (Connectors Soldered)
3pi+ 2040 Robot Kit with 75:1 LP Motors (Turtle Edition Kit)
6V, 2.5A Step-Up/Step-Down Voltage Regulator S13V25F6
12V, 2.5A Step-Up/Step-Down Voltage Regulator S13V25F12
6V, 3.3A Step-Down Voltage Regulator D30V30F6
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Menu
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors