Derivative Calculator

How the Derivative Calculator Works

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.

How the Derivative Calculator works

Maxima takes care of actually computing the derivative of the mathematical function. Like any computer algebra system, it applies a number of rules to simplify the function and calculate the derivatives according to the commonly known differentiation rules. Maxima's output is transformed to LaTeX again and is then presented to the user.

Displaying the steps of calculation is a bit more involved, because the Derivative Calculator can't completely depend on Maxima for this task. Instead, the derivatives have to be calculated manually step by step. The rules of differentiation (product rule, quotient rule, chain rule, …) have been implemented in JavaScript code. There is also a table of derivative functions for the trigonometric functions and the square root, logarithm and exponential function. In each calculation step, one differentiation operation is carried out or rewritten. For example, constant factors are pulled out of differentiation operations and sums are split up (sum rule). This, and general simplifications, is done by Maxima. For each calculated derivative, the LaTeX representations of the resulting mathematical expressions are tagged in the HTML code so that highlighting is possible.

The "Check answer" feature has to solve the difficult task of determining whether two mathematical expressions are equivalent. Their difference is computed and simplified as far as possible using Maxima. For example, this involves writing trigonometric/hyperbolic functions in their exponential forms. If it can be shown that the difference simplifies to zero, the task is solved. Otherwise, a probabilistic algorithm is applied that evaluates and compares both functions at randomly chosen places.

The interactive function graphs are computed in the browser and displayed within a canvas element (HTML5). For each function to be graphed, the calculator creates a JavaScript function, which is then evaluated in small steps in order to draw the graph. While graphing, singularities (e.g. poles) are detected and treated specially. The gesture control is implemented using Hammer.js.

If you have any questions or ideas for improvements to the Derivative Calculator, don't hesitate to write me an e-mail.


(*) Bản quyền bài viết thuộc về SachHay24H.com. Khi chia sẻ, cần phải dẫn link, trích dẫn nguồn đầy đủ về SachHay24h.Com. Mọi hành vi sao chép hoặc trích nguồn, chia sẻ bài viết không đầy đủ đều không được chấp nhận và phải gỡ bỏ.
Go HomePage: Sách Hay 24H hoặc click: Sách hay nhất mọi thời đại, Mua sách online, Bạn đắt giá bao nhiêu, Truyện cổ tích Việt Nam, Mùa xuân nho nhỏ, Tràng giang, Hịch tướng sĩ

Sách cùng danh mục
Thiếu nhi Tịnh Biên hưởng ứng cuộc thi “Bác Hồ với thiếu nhi - Thiếu nhi với Bác Hồ” | Cổng thông tin điện tử tỉnh An Giang

Thiếu nhi Tịnh Biên hưởng ứng cuộc thi “Bác Hồ với thiếu nhi - Thiếu nhi với Bác Hồ” | Cổng thông tin điện tử tỉnh An Giang

Thiếu nhi Tịnh Biên hưởng ứng cuộc thi “Bác Hồ với thiếu nhi - Thiếu nhi với Bác Hồ” | Cổng thông...

Well-ness6 Dấu hiệu nội lực của bạn đang lớn dần

Well-ness6 Dấu hiệu nội lực của bạn đang lớn dần

Dạy con tập nói: Kiến thức cần biết

Dạy con tập nói: Kiến thức cần biết

Dạy con tập nói: Kiến thức cần biết

Những câu nói bằng tiếng Anh hay về tình yêu lãng mạn, ý nghĩa

Những câu nói bằng tiếng Anh hay về tình yêu lãng mạn, ý nghĩa

Lá thư từ thiên đường

Lá thư từ thiên đường

Lá thư từ thiên đường

Con trai mất nhưng mẹ chồng lại ngồi cười tủm tỉm trước tủ, mở ra tôi bật khóc nức nở

Con trai mất nhưng mẹ chồng lại ngồi cười tủm tỉm trước tủ, mở ra tôi bật khóc nức nở

Con trai mất nhưng mẹ chồng lại ngồi cười tủm tỉm trước tủ, mở ra tôi bật khóc nức nở

Sách đọc nhiều nhất
Công thức tọa độ trung điểm (siêu hay)

Công thức tọa độ trung điểm (siêu hay)

Công thức tọa độ trung điểm (siêu hay)

Giáo dục

Giáo dục

Giáo dục

Soạn bài Dương phụ hành Kết nối tri thức                               Ngữ văn lớp 11 trang 107 sách Kết nối tri thức tập 1

Soạn bài Dương phụ hành Kết nối tri thức Ngữ văn lớp 11 trang 107 sách Kết nối tri thức tập 1

Soạn bài Dương phụ hành Kết nối tri thức Ngữ văn lớp 11 trang 107 sách Kết...

Đóng vai người lính kể lại bài thơ Đồng chí của Chính Hữu điểm cao

Đóng vai người lính kể lại bài thơ Đồng chí của Chính Hữu điểm cao

Đóng vai người lính kể lại bài thơ Đồng chí của Chính Hữu điểm cao

Thơ Đường luật là gì (chi tiết nhất)

Thơ Đường luật là gì (chi tiết nhất)

Thơ Đường luật là gì (chi tiết nhất)

Xéo xắt hay Xéo sắc? Từ nào mới đúng để chỉ sự chua ngoa?

Xéo xắt hay Xéo sắc? Từ nào mới đúng để chỉ sự chua ngoa?

Xéo xắt hay Xéo sắc? Từ nào mới đúng để chỉ sự chua ngoa?

Review sách hay, sách hay nên đọc tại Sách Hay 24H.