*Article* **Not Another Computer Algebra System: Highlighting** *wxMaxima* **in Calculus**

**Natanael Karjanto 1,\* and Husty Serviana Husain <sup>2</sup>**


**Abstract:** This article introduces and explains a computer algebra system (CAS) *wxMaxima* for Calculus teaching and learning at the tertiary level. The didactic reasoning behind this approach is the need to implement an element of technology into classrooms to enhance students' understanding of Calculus concepts. For many mathematics educators who have been using CAS, this material is of great interest, particularly for secondary teachers and university instructors who plan to introduce an alternative CAS into their classrooms. By highlighting both the strengths and limitations of the software, we hope that it will stimulate further debate not only among mathematics educators and software users but also also among symbolic computation and software developers.

**Keywords:** computer algebra system; *wxMaxima*; Calculus; symbolic computation

#### **1. Introduction**

A computer algebra system (CAS) is a program that can solve mathematical problems by rearranging formulas and finding a formula that solves the problem, as opposed to just outputting the numerical value of the result. *Maxima* is a full-featured open-source CAS: the software can serve as a calculator, provide analytical expressions, and perform symbolic manipulations. Furthermore, it offers a range of numerical analysis methods for equations or systems of equations that otherwise cannot be solved analytically. It can sketch graphical objects with excellent quality.

What is *wxMaxima*, then? *wxMaxima* is a document-based graphical user interface (GUI) for the CAS *Maxima*. It allows us for using all of *Maxima*'s functions. Additionally, it provides convenient wizards for accessing the most commonly used features, including inline plots and simple animations. Similar to *Maxima*, *wxMaxima* is free of charge, and it is released and distributed under the terms of the GNU General Public License (GPL). This allows for everyone to modify and distribute it, as long as its license remains unmodified. In this article, we use the term "*wxMaxima*" more often, but the terms "*Maxima*" and "*wxMaxima*" can be used interchangeably.

*Maxima* is different from other well-known so-called *3M* mathematical software (*Maple*, *Matlab*, *Mathematica*), as they are commercial and one needs to purchase a license before using them. Other open-source mathematics software include *Axiom*, *Reduce*, *SageMath*, *Octave* and *Scilab* (both are for numerical computation), *R* (for statistical computing), and *GeoGebra* (for interactive geometry and algebra), where the latter is quite well-known globally among mathematics educators.

Apart from being free and easy to install, *Maxima* is also updated continuously. Currently, *Maxima* can run natively without emulation on the following operating systems: *Windows*, *Mac OS X*, *Linux*, *Berkeley Software Distribution (FreeBSD)*, *Solaris*, and *Android*. An executable file can be downloaded from *Maxima*'s website [1]. In particular, the installation file for *Windows* operating system is available for download at an open-source software

**Citation:** Karjanto, N.; Husain, H.S. Not Another Computer Algebra System: Highlighting *wxMaxima* in Calculus. *Mathematics* **2021**, *9*, 1317. https://doi.org/10.3390/ math9121317

Academic Editor: Liliya Demidova

Received: 13 May 2021 Accepted: 3 June 2021 Published: 8 June 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

community resource *SourceForge* [2]. One can simply double-click the executable file and follow the instruction accordingly. After the installation is completed, the software is ready to be launched. The whole process takes less than three minutes in total, depending on the Internet connection speed.

This software is introduced because it is free and under the GPL. As a comparison, the total combined cost for purchasing *3M* software is almost USD 5500 for an educational license (see Table 1). Although the expenditure for personal and student licenses are much lower than those for commercial and professional licenses, for colleagues and practitioners in many developing countries, the price is still considered to be costly. Having this in mind, we promote an open-source software that benefits many people who have limited resources, particularly in less affluent countries.

For teaching and learning mathematics, *Maxima* is fairly accessible by many people. Although *SageMath* is popular among university professors for teaching Calculus and Linear Algebra thanks to its user-friendly cloud, the server is rather slow, particularly if one attempts to access it from a developing country with modest Internet connectivity. *SageMath* can be downloaded and installed locally, but it is a huge file. Thus, it is another hindrance for many colleagues in developing countries.


**Table 1.** Software packages and the individuals or institutions through which they were first developed, the year they were launched, and estimated cost in USD.

In what follows, we cover a literature study on *Maxima* for teaching and learning. A study from Malaysia suggests that students who are exposed to *Maxima* while learning Calculus had a significantly better academic performance as compared with the group that followed a traditional teaching method, and showed a better motivation and more confidence towards the subject [3]. Another example comes from Spain, where García et al. proposed to replace *Derive* using *Maxima* [4]. Díaz et al. analyzed the role of *Maxima* in learning Linear Algebra in the context of learning on the basis of competencies [5]. Fedriani and Moyano proposed using *Maxima* in teaching mathematics for business degrees and Alevel students [6]. The authors also presented a report of the main strengths and weaknesses of this software when used in the classroom. Additionally, the CAS *wxMaxima* is used for training future mathematics teachers in Ukraine [7].

Advanced mathematics can also be explored using *Maxima*, as demonstrated by Dehl [8]. A new possibility for interactive teaching in engineering module using *Maxima* was discussed by Žáková [9]. There also exist free Calculus electronic textbooks incorporating *wxMaxima* developed by Zachary Hannan from Solano Community College, Fairfield, California [10]. These books could certainly be adopted into Calculus classrooms. Currently, Hannan is working on PreCalculus, Multivariable Calculus (MVC), Linear Algebra, and Differential Equations textbooks that utilize the software. Thus, we hope to see more *Maxima*-based mathematics textbooks, and this is good news for mathematics educators who are interested in embedding technology and CAS into their classrooms.

Beyond mathematics, some authors used *Maxima* successfully in Classical Mechanics [11] and Chemistry [12]. In particular, for an efficient path in understanding *Maxima*, the latter provides a thorough introduction to exploiting *Maxima* with the focus on utilizing the *wxMaxima* interface. Woollett provided a series of tutorial notes on *Maxima*. Designed for

new users, particularly *Windows* customers, the notes include some nuts-and-bolts suggestions for working with the CAS [13]. Puentedura designed a *Maxima* tutorial workflow for enhancing and transforming the learning process in science and mathematics. He identified that the CAS has at least three essential roles: as a number-crunching calculator, as a tool for paper-and-pencil symbolic mathematical derivation, and as a typesetter [14].

The list of literature reviews presented above is by no means exhaustive. While the literature offers abundant materials on where *wxMaxima* can outstandingly perform, what it can and cannot do is not entirely clear when it comes to teaching Calculus using the software. This article fills the gap in human–computer interaction, both in the technological and pedagogical senses. Furthermore, by highlighting the software's limitations, we hope to stimulate further debate among the symbolic-computation and mathematics-education communities on how to remedy the situation, perhaps by either providing alternative ways in problem-solving or by improving the technological aspects of the CAS itself. From a pedagogical point of view, the students' feedback that was obtained after implementing *wxMaxima* in teaching and learning for multiple semesters could shed light on its accessibility, digital natives' interaction with technology, and uncover a better way of teaching with technology.

In particular, the limitations of *wxMaxima* are examined by revisiting several examples that were considered in the literature. We present some examples of symbolic integration where *wxMaxima* fails to calculate in most of the cases in relation to results from other software. Interestingly, even other CAS that were often regarded as superior to *wxMaxima* have shortcomings as well. Granted, the field of symbolic integration itself, let alone the area of symbolic computation, particularly with different CAS, is a wide range. Both the cited literature and presented examples are by no means exhaustive lists.

Additionally, although Calculus focuses on the mathematical study of continuous change, the subject in itself contains rich examples of symmetrical objects. For example, even and odd functions are symmetric with respect to the *y*-axis and origin, respectively. Geometrically, the graph of even and odd functions remains unchanged after reflection about the *y*-axis and rotation of 180◦ about the origin, respectively. Consequently, the integral of the former with respect to symmetric intervals is twice the integral from zero to the corresponding upper limit, while the integral of the latter vanishes. We assume that either these functions are integrable and the intervals are finite or the integral converges for infinite intervals. Throughout this article, we consider other examples where symmetry occurs in Calculus and illustrate them using *wxMaxima*.

This article is an extended version of our previous work on embedding technology into Calculus teaching and learning [15]. We investigate the following research questions: Where can *wxMaxima* perform exceptionally as a CAS? What is its effectiveness? What are *wxMaxima*'s limitations and weaknesses? This paper is organized as follows. After this introduction, Section 2 discusses *wxMaxima*'s strengths and limitations, which are featured through several examples. Section 3 provides educational benefits when one embeds the software for instructional purposes, in addition to covering some study limitations. Section 4 concludes the study and lays out a future outlook from our discussion.

#### **2.** *wxMaxima***'s Strengths and Weaknesses**

In this section, we cover both *wxMaxima*'s strengths and weaknesses through examples. Although the considered illustrations are mostly Calculus-related, one may consider examples for other subjects as well, including Linear Algebra, Differential Equations, and Discrete Mathematics.

#### *2.1. wxMaxima's Strengths*

When working with Calculus problems, students can verify the result of their manual computations performed by pencil and paper using *wxMaxima*. Since *wxMaxima* is lightweight and fairly straightforward, simple Calculus calculations can be executed within seconds. These include calculating the limit, finding the derivative of a function, and evaluating both definite and indefinite integrals. The syntax is relatively easy to understand by someone who has no or little experience in programming. In what follows, we consider several *wxMaxima* examples that can be useful for Calculus teaching and learning.

**Example 1.** *Calculating limits, derivatives, and integrals:*

$$\lim\_{\mathbf{x}\to 0} \frac{\sin(7\mathbf{x})}{\mathbf{x}}, \qquad \qquad \frac{d}{d\mathbf{x}} \cos(3\mathbf{x}^2), \qquad \qquad \int \frac{1}{1+\mathbf{x}^2} d\mathbf{x}, \qquad \qquad \int\_0^1 \frac{1}{1+\mathbf{x}^2} d\mathbf{x}.$$

Example 1 provides simple examples of calculating limits, derivatives, and integrals, both definite and indefinite. All functions in this example are even. Table 2 displays the *wxMaxima* command inputs and their corresponding outputs. Our experience as instructors suggests that *wxMaxima* is also handy for obtaining quick and excellent-quality graphical plots, particularly three-dimensional objects that can be hard to sketch manually. In turn, this visualization enhances students' understanding of applying Calculus concepts.

**Example 2.** *Sketching functions (2D plots):*


Example 2 gives examples of generating 2D plots of a single polynomial function and an exponential function together with the corresponding linear approximation. Table 2 shows the *wxMaxima* command inputs, and Figure 1 displays the corresponding outputs. The plot on the left-hand side can be used to verify the theoretical computation of the local extrema, increasing or decreasing test, and concavity test to a cubic function *f*(*x*) = <sup>2</sup>*x*<sup>3</sup> − <sup>7</sup>*x*<sup>2</sup> − <sup>5</sup>*<sup>x</sup>* + 4. The plot on the right-hand side shows a linear approximation *<sup>L</sup>*(*x*) of an exponential function *g*(*x*) = *e<sup>x</sup>* at *x* = 0. The sketching quality in *wxMaxima* is remarkably excellent, and the task is completed swiftly. *SageMath* is rather slow to produce plots, and *WolframAlpha*'s free version generates poor quality plots.

**Table 2.** Examples of *wxMaxima* commands and their corresponding outputs covering limit, derivative, integral, and 2D plots.


**Figure 1.** 2D plot outputs of a cubic function *<sup>y</sup>* <sup>=</sup> *<sup>f</sup>*(*x*) = <sup>2</sup>*x*<sup>3</sup> <sup>−</sup> <sup>7</sup>*x*<sup>2</sup> <sup>−</sup> <sup>5</sup>*<sup>x</sup>* <sup>+</sup> 4 (**left**), and the exponential function *<sup>y</sup>* <sup>=</sup> *<sup>g</sup>*(*x*) = *e<sup>x</sup>* and its linear approximation at (0, 1), *y* = *L*(*x*) = 1 + *x* (**right**).

**Example 3.** *2D and 3D parametric plots:*


Example 3 gives illustrations of parametric plots in both 2D plane and 3D space. The *wxMaxima* input commands and their corresponding outputs are presented in Table 3. A 2D plot of the polar curve cardioid *<sup>r</sup>*(*t*) = <sup>1</sup> <sup>−</sup> sin *<sup>t</sup>*, 0 <sup>≤</sup> *<sup>t</sup>* <sup>≤</sup> <sup>2</sup>*π*, and a 3D plot of helix *<sup>r</sup>*(*t*) = cos *t*, sin *t*, *t*, 0 ≤ *t* ≤ 5*π* are given on the left and right panels of Figure 2, respectively.

**Figure 2.** (**left**) The output of 2D parametric plot showing a polar curve cardioid *r*(*t*) = 1 − sin *t*, 0 ≤ *t* ≤ 2*π*. (**right**) An output of a 3D parametric plot displaying a vector-valued function helix *<sup>r</sup>*(*t*) = cos *<sup>t</sup>*, sin *<sup>t</sup>*, *<sup>t</sup>*, 0 <sup>≤</sup> *<sup>t</sup>* <sup>≤</sup> <sup>5</sup>*π*. These particular cardioid and helix are symmetric with respect to the *y*- and *z*-axes, respectively.

Two of integral applications are calculating the area enclosed by a polar curve and the arc length of a parametric curve. The commands to calculate the area *A* enclosed by the cardioid and the length of the helix *L* and their corresponding results are also given in Table 3. Mathematically, they are performed as follows, where the prime denotes differentiation with respect to *t*:

$$\begin{aligned} A &= \int\_0^{2\pi} \frac{1}{2} r^2 \, dt = \int\_0^{2\pi} \frac{1}{2} (1 - \sin t)^2 \, dt = \frac{3\pi}{2} \\\ L &= \int\_0^{5\pi} \sqrt{\mathbf{x}'(t)^2 + y'(t)^2 + z'(t)^2} \, dt = \int\_0^{5\pi} \sqrt{\sin^2 t + \cos^2 t + 1} \, dt = 5\sqrt{2}\pi. \end{aligned}$$

**Table 3.** Examples of *wxMaxima* commands and their corresponding outputs showing 2D and 3D plots of parametric curves cardioid and helix, respectively, and their corresponding arc lengths.


**Example 4.** *3D surfaces of Möbius band and torus:*

$$\begin{aligned} \mathbf{s}(\mathbf{x}, y) &= \left\langle \left( 3 + y \cos \frac{\mathbf{x}}{2} \right) \cos \mathbf{x}, \left( 3 + y \cos \frac{\mathbf{x}}{2} \right) \sin \mathbf{x}, y \sin \frac{\mathbf{x}}{2} \right\rangle & \text{[Mübüs band]}\\ \mathbf{t}(\boldsymbol{\theta}, \boldsymbol{\phi}) &= \langle \left( 2 + \cos \boldsymbol{\theta} \right) \cos \boldsymbol{\phi}, \left( 2 + \cos \boldsymbol{\theta} \right) \sin \boldsymbol{\phi}, \sin \boldsymbol{\theta} \rangle, \qquad 0 \le \boldsymbol{\theta}, \boldsymbol{\phi} < 2\pi. \qquad \text{[torus]} \end{aligned}$$

The *wxMaxima* input commands and their corresponding outputs are given in Table 4 and Figure 3, respectively. Three-dimensional plots such as this Möbius band and torus can be rotated easily in any direction. Sometimes also called the Möbius strip, the former is a surface with only one side and only one boundary curve, the simplest example of a nonorientable surface. All Möbius bands have a twofold symmetry rotational axis, for which a 180◦ rotation results in strips indistinguishable from the original. The surface finds abundant applications in physical sciences, including nanostructures [16], metamaterials [17], polymeric materials [18], and photonic crystals [19].

The torus example comes from the problem of calculating the volume of solid revolution. It is obtained from a disk (*<sup>x</sup>* − <sup>2</sup>)<sup>2</sup> + *<sup>z</sup>*<sup>2</sup> ≤ 1 revolved about the *<sup>z</sup>*-axis, and thus, it is radially symmetric about the *z*-axis. The desired viewpoint can be obtained easily by setting the elevation and azimuth angles. This is beneficial in comparison to the *Matlab* plots where figures usually have a high number of pixels and are rather heavy to be rotated. Although the surface of revolution is a fascinating object among geometers and topologists, it also finds ample applications in nanophotonics [20], metamaterials [21], magnetized plasma [22], and polymer chemistry [23].

**Table 4.** Examples of *wxMaxima* commands and their corresponding outputs showing 3D plots of parametric surfaces Möbius band and torus.


**Figure 3.** Outputs of (**left**) the 3D surface Möbius band *s*(*x*, *y*) = 3 + *y* cos *<sup>x</sup>* 2 cos *x* **i** + 3 + *y* cos *<sup>x</sup>* 2 sin *x* **j** + *y* sin *<sup>x</sup>* <sup>2</sup> **k**, and (**right**) the torus *t*(*θ*, *φ*)=(2 + cos *θ*) cos *φ* **i** + (2 + cos *θ*) sin *φ* **j** + sin *θ* **k**.

*2.2. wxMaxima's Weaknesses*

In this subsection, we consider several examples where *wxMaxima* is deficient. When sketching a function with singularities, we can discern an improved plot by including supplementary commands. The CAS *wxMaxima* is not particularly strong when it comes to evaluating integrals, particularly the integral of rational functions. This may come as a surprise since the latter are commonplace and considered to be schematically viable.

$$\text{Example 5.}\text{ }A\text{ }sketch\text{ }of\text{ }y = f(x) = \frac{x^2}{x^2 - 1}.$$

In this example, sketching a 2D plot of a function with vertical asymptotes requires an additional instruction. Although the output from "plot2d(x^2/(x^2-1),[x,-4,4]);" input shows that there are two vertical asymptotes at *x* = ±1, modifying the input produces a better visibility, cf. [24]:

"plot2d(max(min(x^2/(x^2-1),10),-10),[x,-4,4]);". Figure 4 compares the 2D plots obtained from these two inputs.

**Figure 4.** (**left**) A 2D plot of *y* = *f*(*x*) = *<sup>x</sup>*<sup>2</sup> *<sup>x</sup>*<sup>2</sup>−<sup>1</sup> without any restriction in the vertical scale. (**right**) The same plot as in the left panel but the vertical axis is restricted to −10 ≤ *y* ≤ 10.

**Example 6.** *Indefinite and definite integrals involving trigonometric functions:*

$$\int \frac{\mathbf{x} \sin \mathbf{x}}{1 + \cos^2 \mathbf{x}} \, d\mathbf{x} \qquad \qquad \text{and} \qquad \int\_0^\pi \frac{\mathbf{x} \sin \mathbf{x}}{1 + \cos^2 \mathbf{x}} \, d\mathbf{x} \dots$$

Both *wxMaxima* and *Matlab* fail to evaluate both integrals. The indefinite integral above involves a non-elementary function Li2(*z*). Special function Li*s*(*z*) is a polylogarithm of order *s* and argument *z*. It is also known as the Jonquière's function and is defined by a power series in *z*; it is also a Dirichlet series in *s*:

$$\operatorname{Li}\_s(z) = \sum\_{k=1}^{\infty} \frac{z^k}{k^s}.$$

Both *WolframAlpha* and *Mathematica* can produce a correct answer for the above definite integral: *π*2/4. Although treatment of the indefinite integral is beyond the Calculus course, the definite integral can be evaluated using a simple substitution rule. Appendix A shows how to evaluate it without any help from CAS.

**Example 7.** *Gärtner's indefinite integral of a rational function [25]:*

$$
\int \frac{\sqrt{2} \, dx}{(x - 1)^4 + \frac{1}{16}}.
$$

When employing the "integrate(sqrt(2)/((x-1)^4+1/16),x);" command, *wx-Maxima* could not directly handle this integral. However, using the substitution *y* = *x* − 1: "changevar(%,x-1-y,y,x);", the integral transforms into

$$
\int \frac{16\sqrt{2} \, dy}{16y^4 + 1}.
$$

Asking *wxMaxima* to evaluate the integral, "ev(%,integrate);", we obtain

$$2\log(4y^2+2\sqrt{2}y+1)-2\log(4y^2-2\sqrt{2}y+1)+4\operatorname{atan}\left(\frac{4y+\sqrt{2}}{\sqrt{2}}\right)+4\operatorname{atan}\left(\frac{4y-\sqrt{2}}{\sqrt{2}}\right).$$

Substituting back to the original variable gives us the desired integral, "sfx: %,y=x-1":

$$\begin{aligned} &2\log(4(\mathbf{x}-1)^2+2\sqrt{2}(\mathbf{x}-1)+1)-2\log(4(\mathbf{x}-1)^2-2\sqrt{2}(\mathbf{x}-1)+1) \\ &+4\operatorname{atan}\left(\frac{4(\mathbf{x}-1)+\sqrt{2}}{\sqrt{2}}\right)+4\operatorname{atan}\left(\frac{4(\mathbf{x}-1)-\sqrt{2}}{\sqrt{2}}\right). \end{aligned}$$

In attempting to solve indefinite integrals of rational functions, *wxMaxima* essentially still uses the algorithms that were described by Moses [26]. The CAS employs the classical algorithmic tool in symbolic integration known as Hermite reduction. Both Hermite and Ostrogradsky demonstrated decomposing indefinite integral of rational functions as the sum of a function with simple poles and the derivative of another rational function, i.e., for *R* ∈ Q(*x*)

$$\int R(\mathbf{x}) \, d\mathbf{x} = \mathcal{U}(\mathbf{x}) + \int A(\mathbf{x}) \, d\mathbf{x}, \qquad \mathcal{U}, \ A \in \mathbb{Q}(\mathbf{x}).$$

where *A* has only simple poles and vanishes at infinity [27–30].

Thus, *wxMaxima* implements the combination of Hermite reduction with either the partial fraction decomposition (Bernoulli–Leibniz algorithm) to compute the rational part of the integrand or with some heuristic methods in computing its transcendental parts for several easier cases. Although other commercial software such as *Axiom* and *3M* might also implement integration using Hermite reduction for the rational part of the integrand, it employs more contemporary and advanced methods to integrate the remaining terms after Hermite reduction is implemented.

**Example 8.** *Bronstein's definite integral of a rational function [31]:*

$$\int\_{1}^{2} \frac{x^4 - 3x^2 + 6}{x^6 - 5x^4 + 5x^2 + 4} \, dx.$$

When we attempt the command "integrate((x^4-3\*x^2+6)/(x^6-5\*x^4+5\*x^2+4), x,1,2);", *wxMaxima* could not compute this integral. However, *Axiom* and *3M* can tackle it. *Axiom*'s output reads:

$$\frac{2\tan(8) + 2\tan(5) + 2\tan(2) + 2\tan\left(\frac{1}{2}\right) - \pi}{2}.$$

*Maple*'s output is given as follows:

$$
\arctan\left(\frac{1}{2}\right) - \frac{1}{2}\pi + \arctan(5) + \arctan(8) + \arctan(2).
$$

Interestingly, *Mathematica* and *Matlab* give the following outputs, respectively, which were simpler than the ones from the previous two software:

$$
\frac{5}{4}\pi - \arctan(2) \qquad \text{and} \qquad \pi - \arctan(1/3).
$$

All of these results correspond to an identical numerical value of approximately 2.819842. The proof is shown in Appendix B.1.

It would also be interesting to observe the corresponding indefinite integral. While *wxMaxima* anticipatedly cannot compute the indefinite integral, *Axiom*, *Maple*, and *Matlab* delivered the same results and agreed with Formula (2.20) in [31]. This reads

$$\int \frac{\mathbf{x}^4 - 3\mathbf{x}^2 + 6}{\mathbf{x}^6 - 5\mathbf{x}^4 + 5\mathbf{x}^2 + 4} \, d\mathbf{x} = \arctan(\mathbf{x}) + \arctan(\mathbf{x}^3) + \arctan\left(\frac{\mathbf{x}^5 - 3\mathbf{x}^3 + \mathbf{x}}{2}\right) + C.$$

In particular, *Mathematica* is of special interest as the output of the corresponding indefinite integral does not agree with the formula given in [31]. It reads as follows (some terms were rearranged):

$$\int \frac{\mathbf{x}^4 - 3\mathbf{x}^2 + 6}{\mathbf{x}^6 - 5\mathbf{x}^4 + 5\mathbf{x}^2 + 4} \, d\mathbf{x} = \frac{1}{2} \arctan \left[ \frac{\mathbf{x}(\mathbf{x}^2 - 3)}{\mathbf{x}^2 - 2} \right] - \frac{1}{2} \arctan \left[ \frac{\mathbf{x}(\mathbf{x}^2 - 3)}{2 - \mathbf{x}^2} \right] + C.$$

The definite integral is given as follows:

$$\begin{split} \int\_{1}^{2} \frac{\mathbf{x}^{4} - 3\mathbf{x}^{2} + 6}{\mathbf{x}^{6} - 5\mathbf{x}^{4} + 5\mathbf{x}^{2} + 4} d\mathbf{x} &= \lim\_{t \to \sqrt{2}} \left\{ \frac{1}{2} \arctan \left[ \frac{\mathbf{x}(\mathbf{x}^{2} - 3)}{\mathbf{x}^{2} - 2} \right] - \frac{1}{2} \arctan \left[ \frac{\mathbf{x}(\mathbf{x}^{2} - 3)}{2 - \mathbf{x}^{2}} \right] \right\} - \arctan(2) \\ &+ \arctan(1) - \lim\_{t \to \sqrt{2}} \left\{ \frac{1}{2} \arctan \left[ \frac{\mathbf{x}(\mathbf{x}^{2} - 3)}{\mathbf{x}^{2} - 2} \right] - \frac{1}{2} \arctan \left[ \frac{\mathbf{x}(\mathbf{x}^{2} - 3)}{2 - \mathbf{x}^{2}} \right] \right\} \\ &= \left( \frac{\pi}{2} - \arctan(2) \right) + \left( \frac{\pi}{4} + \frac{\pi}{2} \right) = \frac{5}{4}\pi - \arctan(2). \end{split}$$

The first and second chapters of [31] explain outline algorithms for the integration of rational functions in great detail. All relevant algorithms are given in pseudocodes. With an estimated effort of 500 to 700 lines of code, these algorithms can be implemented in *wxMaxima*.

**Example 9.** *Adamchik's definite integral of a rational function [32]:*

$$\int\_0^4 \frac{x^2 + 2x + 4}{x^4 - 7x^2 + 2x + 17} \, dx.$$

For an indefinite integral, *wxMaxima* could not compute it. Other software, namely, *Axiom*, *Maple*, and *Matlab*, presented an identical solution but with rather dissimilar expressions:

$$\int \frac{\mathbf{x}^2 + 2\mathbf{x} + 4}{\mathbf{x}^4 - 7\mathbf{x}^2 + 2\mathbf{x} + 17} \, d\mathbf{x} = \arctan(\mathbf{x} - 1) + \arctan\left(\frac{1}{3}\mathbf{x}^3 - \frac{1}{2}\mathbf{x}^2 - \mathbf{x} + \frac{5}{3}\right) + C.$$

On the other hand, the computational result from *Mathematica* produced an antiderivative expression with discontinuities at *x* = ±2:

$$\int \frac{\mathbf{x}^2 + 2\mathbf{x} + 4}{\mathbf{x}^4 - 7\mathbf{x}^2 + 2\mathbf{x} + 17} \, d\mathbf{x} = \frac{1}{2} \arctan\left(\frac{-\mathbf{x} - 1}{\mathbf{x}^2 - 4}\right) - \frac{1}{2} \arctan\left(\frac{\mathbf{x} + 1}{\mathbf{x}^2 - 4}\right) + C.$$

For the definite integral, while all numerical results agree, the symbolic outputs yield remarkably distinct expressions. The outputs are given as follows:

$$\begin{aligned} \int\_0^4 \frac{x^2 + 2x + 4}{x^4 - 7x^2 + 2x + 17} dx &= \frac{\pi}{4} + \arctan(3) - \arctan\left(\frac{5}{3}\right) + \arctan\left(\frac{41}{3}\right) & & & \text{[Aximu and Maple]}\\ &= \frac{5}{4}\pi - \arctan\left(\frac{75}{11}\right) & & & \text{[Matllab]}\\ &= \pi - \arctan\left(\frac{1}{4}\right) - \arctan\left(\frac{5}{12}\right) & & & \text{[Matlhematica]}\\ &= (\text{a tedaius and completed expression}) & & & \text{[uxMaxima]}\\ &\approx 2.50182 & & & \text{[numeriral value]}.\end{aligned}$$

Although *wxMaxima* computes and produces an output for the definite integral, that expression is exceptionally tedious and complicated. It is also unclear how it was obtained, but possibly by performing a contour integration. Despite that tiresome and intricate expression, its numerical evaluation yields a value that agrees with the one calculated by other software. A high floating-point precision command, e.g., "fpprec:150" needs to be imposed to obtain that numerical value. Except for the exact *wxMaxima* output, Appendix B.2 verifies that the above outputs had identical values.

Similar to Example 8, when we want to use *Mathematica*'s antiderivative result to compute the value of the definite integral, we need to split the interval of integration at the point of discontinuity to avoid a wrong result of <sup>−</sup> arctan<sup>1</sup> 4 <sup>−</sup> arctan <sup>5</sup> 12 . The computational summary is given as follows:

$$\begin{split} \int\_{0}^{4} \frac{\mathbf{x}^{2} + 2\mathbf{x} + 4}{\mathbf{x}^{4} - 7\mathbf{x}^{2} + 2\mathbf{x} + 17} \, d\mathbf{x} &= \lim\_{t \to 2^{-}} \left\{ \frac{1}{2} \arctan\left(\frac{-t - 1}{t^{2} - 4}\right) - \frac{1}{2} \arctan\left(\frac{t + 1}{t^{2} - 4}\right) \right\} - \arctan\left(\frac{1}{4}\right) \\ &\qquad - \arctan\left(\frac{5}{12}\right) - \lim\_{t \to 2^{+}} \left\{ \frac{1}{2} \arctan\left(\frac{-t - 1}{t^{2} - 4}\right) - \frac{1}{2} \arctan\left(\frac{t + 1}{t^{2} - 4}\right) \right\} \\ &= \left[ \frac{\pi}{2} - \arctan\left(\frac{1}{4}\right) \right] - \left[ \arctan\left(\frac{5}{12}\right) - \frac{\pi}{2} \right] \\ &= \pi - \arctan\left(\frac{1}{4}\right) - \arctan\left(\frac{5}{12}\right) . \end{split}$$

**Example 10.** *Tobey's indefinite integral of a rational function [33]:*

$$\int \frac{7x^{13} + 10x^8 + 4x^7 - 7x^6 - 4x^3 - 4x^2 + 3x + 3}{x^{14} - 2x^8 - 2x^7 - 2x^4 - 4x^3 - x^2 + 2x + 1} \, dx \dots$$

Except for *wxMaxima*, all other CAS can compute this integral. The result can be found on page 502 of [34] using the Rothstein–Trager method. It reads

$$\frac{1}{2}(1+\sqrt{2})\log\left(\mathbf{x}^{\mathsf{T}}-\sqrt{2}\,\mathbf{x}^{2}-(1+\sqrt{2})\mathbf{x}-1\right)+\frac{1}{2}(1-\sqrt{2})\log\left(\mathbf{x}^{\mathsf{T}}+\sqrt{2}\,\mathbf{x}^{2}-(1-\sqrt{2})\mathbf{x}-1\right)+\mathbb{C}\dots$$

#### **3. Discussion**

#### *3.1.* wxMaxima *in Perspective*

There exists a distinct paradigm between the CAS mentioned in the Introduction. While *Matlab* is particularly strong in numerical computation, the real forte of *wxMaxima*, *Maple*, and *Mathematica* is symbolic computation. *Matlab* has also incorporated some symbolic features, and the latter three can also perform numerical computations as well.

When it comes to symbolic functionality, *wxMaxima* still has a long way to go to catch up other commercial software. Together with *Axiom* and *SageMath*, a formula editor is missing in *Maxima*, although *wxMaxima* serves efficiently as its user interface. While *Axiom* does not possess graph-theory symbolic functionality, *wxMaxima* does. Unfortunately, Diophantine equation solvers and quantifier elimination are absent in *wxMaxima*, and *SageMath* acquires these two features via *SymPy* and *qepcad* optional packages, respectively. Table 5 summarizes the significantly developed symbolic functionality in various software systems.


**Table 5.** A summary of significantly developed symbolic functionality among various software. *Maxima* has a shortfall in quantifier elimination and Diophantine equation solver. The missing formula editor can be overcome by a user interface *wxMaxima*.

> An important feature of *wxMaxima* that trumps other CAS is the admittance of referring to the result of the last evaluated expression with a percentage sign (%). Although we may organize the commands in spatial order, *wxMaxima* stores information in chronological order. Thus, the % always refers to the most recently executed command, and not necessarily to the one that appears directly above the executed command [11]. As already mentioned in the Introduction, since *wxMaxima* is open-source software, it is maintained by an active community of developers, and thus being updated regularly. New releases occur approximately twice annually. For a proprietary software like *3M*, not everyone can inspect, modify, or enhance, but only a team of developers from the company or organization who maintains exclusive control over it can modify the software. Admittedly, the most important reason for utilizing *wxMaxima*, both in teaching and research is the cost, and many authors agreed on this particular notable reason [10–12].

#### *3.2. Educational Benefit*

There are many educational benefits of embedding CAS *wxMaxima* into teaching and learning, Calculus in particular, and mathematics in general. The software serves as meaningful assistance not only to students but also to instructors in verifying handcomputed results, obtaining numerical values of tedious expressions, and providing richquality graphical plots. Hence, the benefit of algebraic, numerical, and graphical aspects, respectively. The time reduction gained in the labor of manual calculation can be spent for a deeper understanding of key ideas, theoretical concepts, and problem-solving methods.

Some examples discussed in Section 2 support this testimony. By observing the graph of a cubic function, students should establish a connection between the visual plot and the computational result of obtaining intervals where the function is increasing, decreasing, concave up, and concave down. Other features, such as the local maxima and minima, and inflection points should follow naturally. By examining the linear approximation of a function, students should be able to conclude why the approximation works for the variable *x* near a specified point of interest. At an advanced level, this comprehension is advantageous for linear-stability analysis.

The literature does not lack in supplying educational benefits of using CAS in mathematics lessons. From a coding perspective, the programming language in *wxMaxima* flows more naturally in comparison to that in other software, and hence allows for students to autonomously implement simple algorithms [4]. For current and future calculus teachers, *wxMaxima* could reduce the time spent on course preparation [7]. By allowing students to induce judgments and make mistakes, the adoption of *wxMaxima* stimulates the interactive-learning process through testing, evaluation, decision-making, and error correction [9]. Weigand argued that the wise use of CAS could foster students' ability in problem solving, modeling, proving, and communicating [35]. The CAS can even be blended with an innovative pedagogical approach, such as flipped classrooms [36].

Additional benefits come along as more instructors adopt and implement a CAS, particularly *wxMaxima*, into their teaching and learning. However, *wxMaxima* is not a perfect software, as we elaborated through several examples in Section 2.

#### *3.3. Limitation*

This study admits several limitations. First, the extent of course materials in Single-Variable Calculus (SVC) is overwhelmingly profuse while the time is scanty. It covers nine chapters of Stewart's Calculus textbook [37], and they need to be completed in 14 weeks. Embedding technology into teaching and learning contributes an additional burden. In a typical North American university, similar content would be covered in two different courses for two consecutive semesters. Usually called "Calculus 1" and "Calculus 2", they cover Differential and Integral Calculus, respectively. The latter often includes an Introduction to Differential Equations, and Sequence and Series. Hence, teaching Calculus using *wxMaxima* with less material coverage seems to be a promising attempt, as we could pursue in MVC.

Second, despite the superior features of *wxMaxima* and its specialty in symbolic operations, the CAS itself has some weaknesses that could be challenging for beginners to learn, adopt, and adapt, both as instructors and students, where it might be more conspicuous for the latter. The CAS is admittedly far from perfect due to the nature of free and open-source software. Other commercial CAS such as *Mathematica* and *Maple* might be better since the companies that release them possess an army of paid personnel working around the clock to improve the software. Nevertheless, we are not without hope since *wxMaxima* is updated frequently, bugs are fixed, and documentation is improved by a group of volunteer developers who work tirelessly.

#### **4. Conclusions**

In this article, we considered several features of *wxMaxima* that could be useful for enhancing the quality of Calculus teaching and learning. Although the CAS itself is far from perfect, focusing on its strengths might benefit both students and instructors when embedding the software into the subject. We included some examples where *wxMaxima* assists well in understanding Calculus concepts better. These include calculating limit, finding a derivative of a function, evaluating definite and indefinite integrals, generating plots for explicit functions, parametric functions, polar curves, and three-dimensional objects. The visualization aspect enhances excellent teaching.

For teachers and instructors who are currently adopting *Maple* or *Mathematica* in their teaching, we are interested in stimulating a discussion on whether it is viable to integrate, or even switch entirely, to *wxMaxima*. This endeavor is not beyond our reach, at least for a sequence of Calculus courses (PreCalculus, SVC, and MVC).

For Linear Algebra, *Matlab* is still the most popular software among both engineers and educators thanks to its many professional contributors, rigorous development, powerful numerical computation, and additional package *Simulink*. *SageMath* is also becoming popular for Linear Algebra teaching and learning since it utilizes existing open-source libraries specifically designed for Linear Algebra, including *LAPack* and *NumPy*. Since *wxMaxima* also possesses many functions for manipulating matrices, we would not be too ambitious to persuade educational practitioners by considering to switch CAS to *wxMaxima* for Linear Algebra teaching and learning. Some Linear Algebra problems are worth testing using *wxMaxima* nonetheless.

Despite the many admirable qualities of *wxMaxima*, our experience in other courses and with different CAS suggests that some students hate when instructors generally attempt to embed any CAS in general into mathematics teaching and learning. For example, after implementing Calculus with *SageMath* in 2012, some students provided feedback suggesting to eliminate *SageMath* from Calculus teaching. For Linear Algebra, a dedicated one-hour problem-solving session using *Matlab* was not favored among the students. Students' feedback on teaching evaluation consistently mentions that the computer laboratory

sessions are a waste of time and must be replaced by the traditional problem-solving sessions using pen and paper.

From our experience of embedding *wxMaxima* into Calculus courses, both Single-Variable and Multivariable, very few students gave positive feedback regarding the software. The majority of students' comments voice an atmosphere of negativity and resistance, they tend to push away *wxMaxima*. Even if they seem to embrace the CAS favorably, they might forget it as soon as the semester is over. In subsequent courses, their instructors might not use *wxMaxima* anymore. There are other important programming languages (e.g., *Python*, *C++*, and *Java*) that students could master before they enter the job market.

**Author Contributions:** Conceptualization, N.K.; methodology, N.K.; software, H.S.H.; validation, N.K. and H.S.H.; formal analysis, N.K.; investigation, N.K.; resources, N.K.; data curation, N.K.; writing—original draft preparation, N.K.; writing—review and editing, N.K.; visualization, N.K.; supervision, N.K.; project administration, N.K.; funding acquisition, N.K. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Acknowledgments:** The authors gratefully acknowledge Boris Gärtner from Munich, Germany for the fruitful discussion on the limitations of *wxMaxima* and for providing references to the relevant literature, particularly [26,31–34].

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Dedication**

The main author would like to dedicate this article to the memory of his late father Zakaria Karjanto (Khouw Kim Soey, 許金瑞) who not only taught him the alphabet, numbers, and the calendar in his early childhood, but also cultivated the value of hard work, diligence, discipline, perseverance, persistence, and grit. Karjanto Senior was born in Tasikmalaya, West Java, Japanese-occupied Dutch East Indies on 1 January 1944 (Saturday Pahing) and died in Bandung, West Java, Indonesia on 18 April 2021 (Sunday Wage).

#### **Appendix A. Evaluating a Definite Integral without CAS**

The definite integral involving trigonometric functions considered in Example 6 can be evaluated without the aid of any CAS. We have the following lemma:

**Lemma A1.** *For a continuous and rational function f*(*x*) ∈ Q(*x*)

$$\int\_0^\pi \mathbf{x} \, f(\sin \mathbf{x}) \, d\mathbf{x} = \frac{\pi}{2} \int\_0^\pi f(\sin \mathbf{x}) \, d\mathbf{x}.$$

**Proof.** Let *u* = *π* − *x*, then *du* = −*dx*, for *x* = 0, *u* = *π* and *x* = *π*, *u* = 0. We have

$$\begin{aligned} \int\_0^\pi \mathbf{x} \, f(\sin x) \, d\mathbf{x} &= \int\_\pi^0 (\pi - u) \, f(\sin(\pi - u)) \, (-du) = -\pi \int\_\pi^0 f(\sin u) \, du + \int\_\pi^0 u \, f(\sin u) \, du \\ &= \pi \int\_0^\pi f(\sin x) \, dx - \int\_0^\pi x \, f(\sin x) \, dx \\ 2 \int\_0^\pi \mathbf{x} \, f(\sin x) \, dx &= \pi \int\_0^\pi f(\sin x) \, dx \\ \int\_0^\pi \mathbf{x} \, f(\sin x) \, dx &= \frac{\pi}{2} \int\_0^\pi f(\sin x) \, dx. \end{aligned}$$

The proof is complete.

We now have the following proposition.

**Proposition A1.**

$$\int\_0^\pi \frac{x \sin x}{1 + \cos^2 x} \, dx = \frac{\pi^2}{4}.$$

**Proof.** There are at least three approaches with subtle differences in tackling this problem. The first method is by taking *<sup>f</sup>*(*x*) = *<sup>x</sup>*/(<sup>2</sup> − *<sup>x</sup>*2) and applying Lemma A1. We then obtain

$$\int\_0^\pi x f(\sin x) \, dx = \int\_0^\pi \frac{x \sin x}{2 - \sin^2 x} \, dx = \int\_0^\pi \frac{x \sin x}{1 + \cos^2 x} \, dx = \frac{\pi}{2} \int\_0^\pi \frac{\sin x}{1 + \cos^2 x} \, dx$$

$$= -\frac{\pi}{2} \int\_0^\pi \frac{d(\cos x)}{1 + \cos^2 x} \, dx = -\frac{\pi}{2} \tan^{-1}(\cos x) \Big|\_0^\pi = -\frac{\pi}{2} (\tan^{-1}(-1) - \tan^{-1}1) = \frac{\pi^2}{4}.$$

The second technique is by writing *x* = *<sup>x</sup>* <sup>−</sup> *<sup>π</sup>* 2 + *<sup>π</sup>* <sup>2</sup> and substituting *<sup>u</sup>* <sup>=</sup> *<sup>x</sup>* <sup>−</sup> *<sup>π</sup>* <sup>2</sup> . It becomes

$$\int\_0^{\pi} \frac{\mathbf{x} \sin \mathbf{x}}{1 + \cos^2 \mathbf{x}} \, d\mathbf{x} = \int\_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \frac{u \cos u}{1 + \sin^2 u} \, du + \frac{\pi}{2} \int\_0^{\pi} \frac{\sin \mathbf{x}}{1 + \cos^2 \mathbf{x}} \, d\mathbf{x}.$$

The first integral of the right-hand side vanishes since the integrand is an odd function. The second integral follows the first method. The third approach is by substituting *<sup>u</sup>* <sup>=</sup> *<sup>x</sup>* <sup>−</sup> *<sup>π</sup>* 2 directly from the beginning. It yields a slightly different expression from the previous two approaches for the second term of the right-hand side:

$$\int\_0^\pi \frac{\mathbf{x} \sin \mathbf{x}}{1 + \cos^2 \mathbf{x}} \, d\mathbf{x} = \int\_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \frac{u \cos u}{1 + \sin^2 u} \, du + \frac{\pi}{2} \int\_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \frac{\cos u}{1 + \sin^2 u} \, du.$$

Similar to the second technique, the first integral on the right-hand side is zero. Since the integrand of the second integral on the right-hand side is an even function, it simplifies to twice of the integral from *u* = 0 to *u* = *<sup>π</sup>* <sup>2</sup> . Employing another substitution *y* = sin *u*, we obtain the desired result:

$$\int\_0^\pi \frac{\mathbf{x} \sin \mathbf{x}}{1 + \cos^2 \mathbf{x}} \, d\mathbf{x} = \pi \int\_0^{\frac{\pi}{2}} \frac{d(\sin u)}{1 + \sin^2 u} = \pi \tan^{-1}(\sin u) \Big|\_0^{\frac{\pi}{2}} = \pi(\tan^{-1} - 0) = \frac{\pi^2}{4}.$$

The proof is completed.

#### **Appendix B. CAS Output Comparison**

*Appendix B.1. Bronstein's Definite Integral of a Rational Function*

Before verifying that all outputs in Example 8 have the same value, we need the following identity.

**Lemma A2.** *For all x* ∈ R \ {0}

$$
\arctan x + \arctan \left(\frac{1}{x}\right) = \begin{cases} \frac{\pi}{2}, & \text{if } \quad x > 0\\ -\frac{\pi}{2}, & \text{if } \quad x < 0. \end{cases}
$$

**Proof.** For all *x* ∈ R \ {0}, let

$$f(x) = \arctan x + \arctan\left(\frac{1}{x}\right).$$

Then, *f* is differentiable for every *x* = 0 and

$$f'(x) = \frac{1}{1 + x^2} + \frac{\left(-\frac{1}{x^2}\right)}{1 + \frac{1}{x^2}} = 0.1$$

Hence, *<sup>f</sup>* is constant on each connected component of all *<sup>x</sup>* <sup>∈</sup> <sup>R</sup> \ {0}. Since *<sup>f</sup>*(1) = *<sup>π</sup>* <sup>4</sup> <sup>+</sup> *<sup>π</sup>* <sup>4</sup> <sup>=</sup> *<sup>π</sup>* <sup>2</sup> , we conclude that *<sup>f</sup>*(*x*) = *<sup>π</sup>* <sup>2</sup> for all *<sup>x</sup>* <sup>&</sup>gt; 0. And since *<sup>f</sup>*(−1) = <sup>−</sup>*f*(1) = <sup>−</sup>*<sup>π</sup>* 2 , it follows that *<sup>f</sup>*(*x*) = <sup>−</sup>*<sup>π</sup>* <sup>2</sup> for all *<sup>x</sup>* <sup>&</sup>lt; 0. We have completed the proof.

**Proposition A2.** *All outputs in Example 8 are equivalent.*

**Proof.** To show that all outputs are equivalent, we use the identity arctan(2) + arctan<sup>1</sup> 2 <sup>=</sup> *<sup>π</sup>* 2 from Lemma A2. Hence, for *Mathematica* output, we only need to verify that arctan(8)+ arctan(5) = <sup>5</sup> <sup>4</sup>*π*− arctan(2). The left-hand side can be calculated as follows:

$$
\arctan(8) + \arctan(5) = \arctan\left(\frac{8+5}{1-8(5)}\right) = \arctan\left(\frac{13}{-39}\right) = \arctan\left(-\frac{1}{3}\right)
\text{mod}\,\pi\,\,\text{-}\,\frac{\pi}{3} = \frac{\pi}{3}
$$

Applying again a similar identity from Lemma A2 for *<sup>x</sup>* <sup>=</sup> <sup>−</sup><sup>3</sup> <sup>&</sup>lt; 0, arctan −1 3 = arctan(3) <sup>−</sup> *<sup>π</sup>* <sup>2</sup> , we only need to show that

$$
\arctan(3) + \arctan(2) = \frac{5}{4}\pi + \frac{\pi}{2} = \frac{7}{4}\pi.
$$

The left-hand side is calculated as previously:

$$
\arctan(3) + \arctan(2) = \arctan\left(\frac{3+2}{1-3(2)}\right) = \arctan\left(\frac{5}{-5}\right) = \arctan(-1)\text{mod}\,\pi = \frac{7}{4}\pi.
$$

For *Matlab* output, we need to show that arctan(8) + arctan(5) = *<sup>π</sup>* <sup>−</sup> arctan<sup>1</sup> 3 . Using the identity from Lemma A2 that arctan(3) + arctan<sup>1</sup> 3 <sup>=</sup> *<sup>π</sup>* <sup>2</sup> , the right-hand side becomes *<sup>π</sup>* <sup>2</sup> <sup>+</sup> arctan(3). Combining term arctan 3 with one term on the left-hand side, we obtain either

$$\begin{aligned} \arctan(5) + \arctan(8) - \arctan(3) &= \arctan(5) + \arctan\left(\frac{8-3}{1+8(3)}\right) \\ &= \arctan(5) + \arctan\left(\frac{1}{5}\right) \text{mod}\pi = \frac{\pi}{2} \qquad \text{or} \end{aligned}$$

$$\begin{aligned} \arctan(8) + \arctan(5) - \arctan(3) &= \arctan(8) + \arctan\left(\frac{5-3}{1+5(3)}\right) \\ &= \arctan(8) + \arctan\left(\frac{1}{8}\right) \text{mod}\pi = \frac{\pi}{2} \end{aligned}$$

Both identities are correct when we take zero remainder in the congruence relationship. This completes the proof.

#### *Appendix B.2. Adamchik's Definite Integral of a Rational Function*

The results from Adamchik's definite integral of a rational function are verified by the following lemma.

#### **Lemma A3.** *All outputs in Example 9 are identical.*

**Proof.** We show that all exact values are identical. In each case, we take the zero remainder whenever the congruence relationship appears. First, we verify that the *Axiom*/*Maple*'s and *Matlab*'s results are identical, i.e.,

$$\begin{aligned} \frac{5}{4}\pi - \arctan\left(\frac{75}{11}\right) &= \frac{\pi}{4} + \arctan(3) - \arctan\left(\frac{5}{3}\right) + \arctan\left(\frac{41}{3}\right) \\ \pi - \arctan\left(\frac{75}{11}\right) &= \arctan\left(\frac{2}{9}\right)\text{mod}\pi + \arctan\left(\frac{41}{3}\right) \\ &= \arctan\left(\frac{2}{9}\right) + \frac{\pi}{2} - \arctan\left(\frac{3}{41}\right) \qquad \text{(by Lemma A2)} \\ &= \frac{\pi}{2}\arctan\left(\frac{2/9 - 3/41}{1 + (2/9)(3/41)}\right)\text{mod}\pi \\ &\quad \frac{\pi}{2} = \arctan\left(\frac{75}{11}\right) + \arctan\left(\frac{11}{75}\right) .\end{aligned}$$

Second, we show that the *Matlab*'s and *Mathematica* results are identical, i.e.,

$$
\frac{5}{4}\pi - \arctan\left(\frac{75}{11}\right) = \pi - \arctan\left(\frac{1}{4}\right) - \arctan\left(\frac{5}{12}\right).
$$

Bringing *π* to the left-hand side and gathering all inverse tangent terms to the right-hand side, we obtain

$$\begin{split} \frac{\pi}{4} &= \arctan\left(\frac{75}{11}\right) - \arctan\left(\frac{1/4 + 5/12}{1 - (1/4)(5/12)}\right) \text{mod}\pi \\ &= \arctan\left(\frac{75}{11}\right) - \arctan\left(\frac{32}{48}\right) \text{mod}\pi = \arctan\left(\frac{75/11 - 32/43}{1 + (75/11)(32/43)}\right) \text{mod}\pi \\ &= \arctan 1. \end{split}$$

Finally, we confirm that the *Axiom*/*Maple*'s and *Mathematica*'s results are identical, i.e.,

$$
\begin{aligned}
\pi - \arctan\left(\frac{1}{4}\right) - \arctan\left(\frac{5}{12}\right) &= \frac{\pi}{4} + \arctan(3) - \arctan\left(\frac{5}{3}\right) + \arctan\left(\frac{41}{3}\right) \\
\frac{3}{4}\pi - \arctan\left(\frac{32}{43}\right) \text{mod}\,\pi &= \arctan\left(\frac{2}{9}\right) \text{mod}\,\pi + \arctan\left(\frac{41}{3}\right) \\
\frac{3}{4}\pi &= \frac{\pi}{2} - \arctan\left(\frac{43}{32}\right) + \arctan\left(\frac{2}{9}\right) + \arctan\left(\frac{41}{3}\right) \qquad\text{(by Lemma A2)} \\
\frac{\pi}{4} &= \arctan\left(\frac{2}{9}\right) + \arctan\left(\frac{41/3 - 43/32}{1 + (41/3)(43/32)}\right) \text{mod}\,\pi \\
\frac{\pi}{4} &= \arctan\left(\frac{2}{9}\right) + \arctan\left(\frac{7}{11}\right) = \arctan 1.
\end{aligned}
$$

The proof is complete.

#### **References**

