0% found this document useful (0 votes)
5 views1 page

How the Derivative Calculator Works

The document explains how a Derivative Calculator works by first parsing a mathematical function into a tree structure to represent the order of operations. It then transforms this tree into LaTeX code for display and sends it to a server running the computer algebra system Maxima to calculate the derivative when the "Go!" button is clicked.

Uploaded by

Tudor Popica
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

How the Derivative Calculator Works

The document explains how a Derivative Calculator works by first parsing a mathematical function into a tree structure to represent the order of operations. It then transforms this tree into LaTeX code for display and sends it to a server running the computer algebra system Maxima to calculate the derivative when the "Go!" button is clicked.

Uploaded by

Tudor Popica
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

For those with a technical background, the following section explains how the Derivative

Calculator works.
First, a parser analyzes the mathematical function. It transforms it into a form that is
better understandable by a computer, namely a tree (see figure below). In doing this,
the Derivative Calculator has to respect the order of operations. A specialty in
mathematical expressions is that the multiplication sign can be left out sometimes, for
example we write "5x" instead of "5*x". The Derivative Calculator has to detect these
cases and insert the multiplication sign.
The parser is implemented in JavaScript, based on the Shunting-yard algorithm, and
can run directly in the browser. This allows for quick feedback while typing by
transforming the tree into LaTeX code. MathJax takes care of displaying it in the
browser.
When the "Go!" button is clicked, the Derivative Calculator sends the mathematical
function and the settings (differentiation variable and order) to the server, where it is
analyzed again. This time, the function gets transformed into a form that can be
understood by the computer algebra system Maxima.

You might also like