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

CT432-HSWF50DR TMR Current Sensor Large Carrier 0A to 50A, 5V
298:1 Micro Metal Gearmotor LP 6V with 12 CPR Encoder, Back Connector
Pololu H2 High-Power Motor Driver 36v11 CS
A5984 Stepper Motor Driver Carrier, Adjustable Current, Blue Edition
Ribbon Cable with Pre-Crimped Terminals 10-Color M-F 60" (150 cm)
150:1 Micro Metal Gearmotor MP 6V with 12 CPR Encoder, Side Connector
CT433-HSWF30MR TMR Current Sensor Compact Carrier -30A to +30A, 3.3V
ACS72981ELRATR-200U3 Current Sensor Compact Carrier 0A to 200A, 3.3V
CT433-HSWF65DR TMR Current Sensor Compact Carrier 0A to 65A, 3.3V
4.2-15V, 3A Fine-Adjust Step-Down Voltage Regulator w/ Adjustable Low-Voltage Cutoff D30V30MASCMA
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