SymPy

This dialog can be used to perform symbolic differentiation and integration. It is a front-end to SymPy, a Python library for symbolic mathematics that aims to become a full-featured computer algebra system (CAS). It can be activated by selecting either the Differentiate... or the Integrate... commands from the Analysis menu. The dialog is only available if QtiPlot was compiled with built-in Python support and SymPy is installed on your computer.

SymPy installation

On Windows and macOS, assuming that you have pip installed on your system, SymPy can be installed with the help of the following command:


python3 -m pip install sympy

If pip isn't already installed on your system, it can be installed using the command below:


python3 -m ensurepip

On Ubuntu or Debian distributions of Linux, SymPy can be installed with the help of the following command:


sudo apt-get install python3-sympy

Using SymPy dialog

The dialog has two functioning modes: Differentiate and Integrate. It is possible to switch between them using the Analyze list box. The function to analyze should be entered in the text editor below, labeled by default f(x). The result of the evaluation is displayed in the text box at the bottom of the dialog, labeled by default df(x)/dx, and is also stored to the clipboard.

By changing the name of the Variable, which by default is set to x, it is possible to calculate the partial derivatives of a function of several variables.

Figure 5-6. The SymPy dialog box: symbolic differenciation.

If the Notes Window option is checked QtiPlot creates a new note window displaying the Python script used in the back-end for the evaluation of the derivative/integral. A new tab is added to this window for each evaluation.

Figure 5-7. The SymPy dialog box: symbolic integration.

When the Integrate mode is selected and the From/To limits are checked, QtiPlot evaluates the definite integral. Otherwise the indefinite integral is calculated.

Figure 5-8. The SymPy dialog box: evaluation of definite integrals.