Electronic Research Archive http://www.aimspress.com/journal/era ERA, 31(3): 1737–1768. DOI: 10.3934/era.2023090 Received: 22 October 2022 Revised: 21 January 2023 Accepted: 28 January 2023 Published: 06 February 2023 Research article One-sided differentiability: a challenge for computer algebra systems Enrique Ferres-López1,2, Eugenio Roanes-Lozano3,4,*, Angélica Martínez-Zarzuelo4 and Fernando Sánchez5 1 Área de Ingeniería, Centro Universitario de Tecnología y Arte Digital, Madrid, Spain 2 Universidad Complutense de Madrid, Madrid, Spain 3 Instituto de Matemática Interdisciplinar (IMI), Universidad Complutense de Madrid, Madrid, Spain 4 Departamento de Didáctica de Ciencias Experimentales, Sociales y Matemáticas, Facultad de Educación-Centro de Formación del Profesorado, Universidad Complutense de Madrid, Madrid, Spain 5 Departamento de Matemáticas, Facultad de Ciencias, Universidad de Extremadura, Badajoz, Spain * Correspondence: Email: eroanes@ucm.es; Tel: +34913946248. Abstract: Computer Algebra Systems (CASs) are extremely powerful and widely used digital tools. Focusing on differentiation, CASs include a command that computes the derivative of functions in one variable (and also the partial derivative of functions in several variables). We will focus in this article on real-valued functions of one real variable. Since CASs usually compute the derivative of real-valued functions as a whole, the value of the computed derivative at points where the left deriva- tive and the right derivative are different (that we will call conflicting points) should be something like “undefined”, although this isn’t always the case: the output could strongly differ depending on the chosen CAS. We have analysed and compared in this article how some well-known CASs behave when addressing differentiation at the conflicting points of five different functions chosen by the au- thors. Finally, the ability for calculating one-sided limits of CASs allows to directly compute the result in these cumbersome cases using the formal definition of one-sided derivative, which we have also analysed and compared for the selected CASs. Regarding teaching, this is an important issue, as it is a topic of Secondary Education and nowadays the use of CASs as an auxiliary digital tool for teaching mathematics is very common. Keywords: computer algebra systems; one-sided differentiability; real-valued functions of one real variable; limits; software comparison http://http://www.aimspress.com/journal/era http://dx.doi.org/10.3934/era.2023090 1738 1. Introduction We consider in this article functions whose domain and range are both subsets of the set of real numbers (which are usually denoted real-valued functions of one real variable). In previous works [1, 2] we have compared the behaviour of different Computer Algebra Systems (CASs) when evaluating some selected functions and computing their limits at points outside their domain of definition (which would classically be classified as “removable discontinuities” or “jump discontinuities”). CASs can be used to address certain definitions and results regarding limits both from a mathematical point of view and visually (using plots). Let us observe that, from a formal point of view, it makes no sense to evaluate a function outside its domain of definition. However, it is interesting to check what the CAS does when asked to. We show in [1, 2] that the output could strongly differ depending on the chosen CAS (and could even be wrong sometimes). This could be a serious drawback for distance learning and self-study or in any situation where the user of the CAS can’t decide upon the mathematical correctness of what is being asked to the CAS (the input). We have now addressed, from a similar point of view, the problem of how some CASs treats one- sided differentiability. Focusing on differentiation, CASs include a command that computes the derivative of functions in one variable (and also the partial derivative of functions in several variables). Since CASs usually compute the derivative of real-valued functions of one real variable as a whole, if the user asks for the value of the computed derivative at points where the left derivative and the right derivative are different, the answer isn’t always correct (the output should be something like “undefined”). The decisions made in the design step of each CAS condition its behaviour and its subsequent output, as we’ll show below. However, the ability for calculating one-sided limits of many CASs allow to directly compute the re- sult in these cumbersome cases using the formal definition of one-sided derivative [3–6] (strengthening the connection of the digital tool to the mathematical theory). Regarding teaching, this is a topic of Secondary Education in Spain [7] and nowadays the use of CASs as an auxiliary digital tool for teaching mathematics is very common [8]. A first version of this work was presented at the CADGME 2022 conference [9]. 2. About CASs 2.1. Characteristics of CASs CASs have two characteristics that distinguish them from other pieces of software: • Unlike usual software, they use “exact arithmetic” by default (instead of “floating point arith- metic”), so no undesired approximations are carried out internally and the numerical computa- tions are always correct. • They can handle unassigned variables, that is, variables in the mathematical sense, which allows to compute elementary operations, such as simplifying expressions like (x + y)2 − (x − y)2 to 4xy, and to face more complicated processes such as: parametric equations and systems solving, differentiation, integration, etc. Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1739 2.2. The CAS selected There are many CASs available nowadays [10]. Therefore we have selected seven general purpose ones (two “versions” of one of them) and WolframAlpha. They are: • Maple 2022*: one of the most powerful CASs available nowadays [11–15]. Maple 10 (released in 2005 [16]) already claimed to have hundreds of thousands of users worldwide [17]. Maple has packages for very different applications. • Derive 6.1: although discontinued, it was one of the leaders at the end of the XXth century and the beginning of the XXIst century, mainly at Secondary Education and algebra and calculus undergraduate courses [18]. Surprisingly, it is still used for teaching mathematics [19]. • Maxima (wxMaxima 20.12.1): a descendant of one of the pioneer CASs of the 1960s (Macsyma), it is a powerful example of the free CASs available nowadays [20, 21]. • WolframAlpha [22] is much more than a CAS, it has been described as “a computational knowl- edge search engine” [23]. It is included here because it offers CAS capabilities from a very different approach. • Mathematica 13.0: the same said for Maple applies. It is noticeable that it has different program- ming styles [24–27]. • SageMath 8.3 and SageMath Cell Server: a free modern CAS [28, 29] with the possibility to call other CASs for externally performing computations. • SymPy 1.10.1: a free Python library that provides the computer language Python with CAS capa- bilities [30]. • GeoGebra 6.0.735.0: initially a free dynamic geometry system, GeoGebra has quickly evolved including new possibilities like 3D graphics, augmented reality and a small CAS [31]. It has more than 100 million users around the world [32]. Due to the different input and output of the so called “CAS View” and “Algebra View” regarding the topic of this paper, we have treated these “Views” separately. We know we have left aside many powerful general purpose CASs. Just to mention a few we could underline the pioneer CAS REDUCE [33–35] (now free); the powerful Axiom [36] (now free); the multipurpose XCas [37]; the CAS for calculators and computers CAS TI-Nspire, etc. The amount of CASs available is huge [10]. We have selected some of the best known, and we believe the ones chosen are representative of these pieces of software. 2.3. Plotting real-valued functions of one real variable in CASs CASs usually work internally in the complex field C. That can produce unexpected results when plotting real-valued functions of one real variable. Let us consider as illustration the function g(x) = 3√ x2. It is very curious that in Maple plot((x^2)^(1/3),x=-15..15); and plot(x^(2/3),x=-15..15); produce different output in Maple (see Figures 1 and 2). Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1740 Figure 1. Maple plot of (x2)(1/3). Figure 2. Maple plot of x(2/3). The explanation can be found in Maple’s help page: “the expression xˆy is generally evaluated as exp(y*ln(x)), where ln(x) is evaluated using the principal branch of the logarithm”. So, we have: • In the first case, ∀x ∈ R, x2 ∈ R+, so when computing the cube root of x2, the principal (complex) branch of the logarithm always corresponds to positive reals. • In the second case, when directly computing x(2/3), the branch chosen as principal (complex) branch of the logarithm of x isn’t real when x ∈ R and x < 0 (surprisingly, this CAS al- ways chooses as principal branch of the logarithm the one with the smallest argument). It can be checked typing evalf(root(-1,3)); that the argument of the complex root considered as “principal root” of −1 is π3 (instead of π, that would return a negative real value). This behaviour can be avoided in Maple using function surd instead of ˆ to compute the cube root. For instance: plot(surd(x,3)^2,x=-15..15); plots the two branches of ( 3 √ x)2 while plot((x^(1/3))^2,x=-15..15); as well as plot(root(x,3)^2,x=-15..15); *All product names, trademarks and registered trademarks are property of their respective owners. Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1741 only plot one branch. Mathematica and Derive do the same as Maple when asked to plot x(2/3). Meanwhile, Maxima and GeoGebra are designed in a different way, and the cube root of a negative real number is a negative real number (they produce the same plot in both cases), which seems closer to what the user would expect. We believe that when a function like 3√ x2 is introduced to the system, it is generally considered as a function R −→ R, not as a function C −→ C, even if the CAS user is trained in complex numbers. Similarly, if we ask someone for the value of 3√ −1, they will probably answer −1, despite the fact that they also know that there are three complex roots: 1π/3, 1π and 15π/3. They will consider the branch with argument π the main one in this case (see [38]). As many CASs internally work in C, this default choice to work in C sometimes surfaces and becomes apparent, as in this case. Normally CASs don’t allow to fix the base algebraic structure (semiring, ring, field) used for the computations (Axiom was very good from this point of view). However, the problem of identifying and computing the branches of a multivalued function (n-th roots and some inverse functions) is not trivial at all. The reader interested in the details of this problem can consult, for example, [39], that analyses formal mathematical approaches as well as computer algebra ones. How it could be approached from the point of view of the markup language OpenMath is addressed in [40]. Generic algorithms that can be used to calculate branch cuts are detailed in [41] and a Maple package based on these ideas is described in [42]. There are even paradoxes related to the exponential function [43]. 2.4. What do we expect from the CASs We consider that a student who uses a CAS to support the learning of a mathematical concept expects the output to be clear, precise and close to the usual mathematical notation in each case. A student typically uses these systems to calculate and check results. However, a mathematician reflects to a greater extent on the CAS output. A mathematician analyses each result and studies what happens with the same concept in different registers (graphical, algebraic, tabular, etc.). CASs are pieces of software with thousands of lines of code and their developers have to make many decisions (for instance, to work in C by default). The decisions made during the design phase don’t affect mathematicians using these CAS as much, because all the approaches considered are most of the times understood. However, in the educational field it is different, because strange although correct output can generate many inconveniences among students, thus influencing the learning of some mathematical concepts. Therefore we have tried to evaluate for each case and each CAS the clarity, precision and similarity with the usual mathematical notation of the output corresponding to the “intuitive input”. 3. Design of the experiment We have chosen five real-valued functions of one real variable which domain is R, a closed interval contained in R or (0,+∞). In all cases there is a “conflicting point” regarding differentiation (each one of a different cause). It has been checked how different CASs address the derivative of the five functions at the “conflicting points”. Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1742 3.1. Summary of the steps carried out with the functions For each chosen real-valued function of one real variable and each selected CAS: 1) we have checked whether the CAS computes the derivative function (as a whole) or not, 2) we have checked whether the CAS wrongly evaluates the derivative function at the point where the function isn’t differentiable or not, 3) we have computed with the CAS (when possible) the left derivative and right derivative of the function at the conflicting point (using the formal definition of one-sided differentiability and the possibility of CASs to compute limits). 3.2. Formal definitions Let f : A −→ R be a real-valued function defined on A ⊆ R. Suppose that a ∈ R is an accumulation point of A, that is, ∀δ > 0 ∃ x ∈ A such that 0 < |x − a| < δ. Definition 1 (limit of a real-valued function of one real variable at a point). We say that limit of f at a is b ∈ R and we write lim x→a f (x) = b if ∀ε > 0 ∃ δ > 0 such that x ∈ A, 0 < |x − a| < δ =⇒ | f (x) − b| < ε. Definition 2 (limit from the right of a real-valued function of one real variable at a point). If a is a right hand accumulation point of A, that is, (a, a + δ) ∩ A , ∅ for all δ > 0, then we say that lim x→a+ f (x) = b if ∀ε > 0 ∃ δ > 0 such that x ∈ A, 0 < x − a < δ =⇒ | f (x) − b| < ε. Definition 3 (limit from the left of a real-valued function of one real variable at a point). If a is a left hand accumulation point of A, that is, (a − δ, a) ∩ A , ∅ for all δ > 0, then we say that lim x→a− f (x) = b if ∀ε > 0 ∃ δ > 0 such that x ∈ A, 0 < a − x < δ =⇒ | f (x) − b| < ε. Consequence 1. If a is a right and left accumulation point of A then the limit of f at a exists if and only if the limits from the left and from the right both exist and are equal. Definition 4 (continuity at some point). f is continuous at a ∈ A if a is an isolated point of A or a is an accumulation point of A and lim x→a f (x) = f (a). Definition 5 (right and left continuity at some point). If a ∈ A is a right hand (resp. left hand) accumulation point of A we say that • f is right continuous at a if lim x→a+ f (x) = f (a), • f is left continuous at a if lim x→a− f (x) = f (a). Consequence 2. if a ∈ A is a right and left accumulation point of A then f is continuous at a if and only if it is left and right continuous at a. Definition 6 (differentiability). We say that f is differentiable at a if ∃ f ′(a) = lim x→a f (x) − f (a) x − a . This number f ′(a) is called derivative of f at a. Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1743 Definition 7 (right and left differentiability). f is right (respectively left) differentiable at a if ∃ f ′+(a) = lim x→a+ f (x) − f (a) x − a (resp. ∃ f ′−(a) = lim x→a− f (x) − f (a) x − a ). In this case f ′+(a) (resp. f ′−(a)) denotes right (resp. left) derivative of f at a. Consequence 3. f (x) is differentiable at a if and only if it is left and right differentiable at a and f ′+(a) = f ′−(a). Remark 1. If lim x→a+ f (x) − f (a) x − a = +∞ then function f isn’t right differentiable at a, but, for the sake of simplicity, we’ll say that f ′+(a) = +∞. Something analogous can be said if that limit is −∞. The same will be said for the left derivative f ′−(a) and for the derivative f ′(a). 3.3. The five functions chosen 3.3.1. Function f (x) The following function (Figure 3): f (x) = −2, if x < 1 x2, if x ≥ 1 is continuous and differentiable in R\{1}. The derivative of function f (x) is f ′(x) = 0, if x < 1 2x, if x > 1. Therefore, it has different one-sided derivatives at 1 (+∞ and 2) and different one-sided tangent lines at 1. Figure 3. Plot of function f (x) in red and its derivative in blue. Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1744 3.3.2. Absolute value function Function |x| (Figure 4) is continuous in R and differentiable in R\{0}. The derivative of |x| with respect to x is: |x|′ = −1, if x < 0 1, if x > 0. Therefore, it has different one-sided derivatives at 0 (−1 and 1) and different one-sided tangent lines at 0. Figure 4. Plot of function |x| in red and its derivative in blue. 3.3.3. Function g(x) The following function (Figure 5): g(x) = 3√ x2 is continuous in R and differentiable in R\{0}. The derivative of g(x) with respect to x is : g′(x) = 2 3x1/3 , x ∈ R\{0}. Function g(x) isn’t differentiable at 0 (it has different one-sided derivatives at 0: −∞ and +∞). Although the one-sided derivatives at this singularity are different, g(x) has a vertical tangent line (in the sense of [5]) at 0. Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1745 Figure 5. Plot of function g(x) in red an its derivative in blue. Remark 2. Let us observe that we won’t explore what happens with alternative equivalent expressions for the functions chosen in this paper, as it is already a long one and that isn’t the goal of this paper. We’ll choose a certain mathematical way to express the function in all cases and translate it into the notation of the different chosen CAS. For instance, in this case, we’ll always introduce the function as: g(x) = 3√ x2 = (x2) 1 3 From the mathematical point of view, as we are considering real-valued functions of one real vari- able (x2) 1 3 = x2/3 = (x 1 3 )2 However, some CASs perform computations in C and the results could be different than in R (see Section 2.3). For instance, the Maple output for this function depends on the input. If the input is: > g:=x->(x^2)^(1/3): > diff(g(x),x); the output is g′(x) = 2x 3(x2) 2 3 . Meanwhile, if the input is: > g:=x->x^(2/3): > diff(g(x),x); the output is: g′(x) = 2 3x1/3 . Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1746 3.3.4. Function h(x) The following function (Figure 6): h(x) = √ cos x − cos3 x , x ∈ [ − π 2 , π 2 ] is continuous in [ −π2 , π 2 ] ⊆ R. The derivative of h(x) with respect to x is h′(x) = − sin(x) + 3 cos(x)2 sin(x) 2 √ cos(x) − cos(x)3 , x ∈ R\{0} and it has different one-sided derivatives at 0 (−1 and 1). Consequently, the one-sided tangent half-lines at this singularity are different. Figure 6. Plot of function h(x) in red and its derivative in blue. 3.3.5. Natural logarithm function Function ln(x), also denoted log(x) (Figure 7), is continuous and differentiable in (0,+∞) ⊆ R. Its derivative is 1 x , x ∈ (0,+∞). Function ln(x) isn’t defined at x = 0, hence it can be neither continuous nor differentiable at this point, so it makes no sense to consider its one-sided tangent line at 0 for x > 0. Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1747 Figure 7. Plot of function ln(x) in red and its derivative in blue. 3.3.6. Why were these functions chosen The domain of the three first functions is R, the domain of the fourth function is [ −π2 , π 2 ] and the domain of the fifth function is (0,+∞). Therefore the domains of all these functions are connected sets. All the functions except f (x) are continuous on its domain, but only the fifth function is differen- tiable on its whole domain. They represent those which we have considered the main different cases: • The piecewise function f (x) has a jump discontinuity at 1 and is right continuous and right differ- entiable at 1. • Function |x| is continuous at 0, it isn’t differentiable at 0, but it is right and left differentiable at 0 and has two different tangent half-lines at 0. Although the derivative function is not defined at 0, it could be said it has a jump discontinuity at this point. • Function g(x) = 3√ x2 is continuous at 0, it is neither right differentiable nor left differentiable at 0, but there is a vertical tangent line to the curve at 0. • Function h(x) = √ cos x − cos3 x is continuous at 0, it isn’t differentiable at 0 but is right and left differentiable at 0 and has two different tangent half-lines at 0. • Function ln(x) is only defined in (0,+∞), where it is continuous and differentiable. Therefore at 0 it is possible to consider the right limit of ln(x), but as it isn’t defined at 0 it can be neither right continuous nor right differentiable at this point. 3.4. Related works There are several reviews and comparisons between CASs, like the encyclopedic [44], or focused on a particular issue, for example on symbolic solvers [45], or describing a particular topic such as [46]. And, of course, there are very many applications to the mathematics classroom. However, we know of no work similar to ours: a comparative analysis of different CASs regarding the difficulties of dealing with derivative functions considered as a whole when there are conflicting Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1748 points and bypassing these difficulties using one-sided limits and the formal definition of one-sided derivatives. 4. Results: Approach I (using the CASs symbolic differentiation capability) 4.1. Derivative function computed for the five functions chosen (output) Tables 1 and 2 collect the output obtained when computing the derivatives of the five functions chosen. Table 1. Output obtained when computing the derivative function of the functions f (x) and |x| in the different CAS selected. f (x) = −2 x < 1 x2 x ≥ 1 |x| Maple Output a and b:  0 x < 1 undefined x = 1 2x 1 < x abs(1, x) Derive Output: IF(x < 1, 0, 2 · x) SIGN(x) Maxima Output: Maxima can’t compute it x |x| Wolfram Alpha Output: Wolfram Alpha can’t compute it x |x| Mathematica Output:  0 x < 1 2x x > 1 Indeterminate True x RealAbs[x] SageMath piecewise(x|–>0 on (-oo, 1), Output: x|–>2*x on 1, x|–>2*x on (1, +oo); x) x/abs(x) SymPy Output: 0 : for x < 1 2x : otherwise (re(x) d dx re(x)+im(x) d dx im(x))sign(x) x GG (CAS V.) Output: If(1 > x, 0, 2x) |x| x GG (Alg. V.) Output: 0 : x < 1 2x : otherwise |x| x We have used colours in the tables with the following colour code: • green: the CAS exceeds expectations, returning a mathematically correct answer and presenting Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1749 it in perfect mathematical notation (this colour is reserved to complicated cases); • black: the answer is correct; • blue: the answer is correct but in a strange or unexpected format (for a non-expert or a Secondary School student); • red: the answer isn’t correct or the CAS can’t compute it. The output are commented in detail after Table 2. Table 2. Output obtained when computing the derivative function of the functions g(x), h(x) and ln(x) in the different CAS selected. g(x) = 3√ x2 h(x) = √ cos x − cos3 x ln x Maple Output a and b: 2x 3(x2) 2 3 − sin(x)+3 cos(x)2 sin(x) 2 √ cos(x)−cos(x)3 1 x Derive Output: 2·|x|2/3 3·x SIGN(SIN(x)) ( COS(x)3/2 − SIN(x)2 2· √ (COS(x)) ) 1 x Maxima Output: 2 3x1/3 3 cos(x)2 sin(x)−sin(x) 2 √ cos(x)−cos(x)3 1 x Wolfram Alpha Output: 2x 3 3√ x2 2 sen(x)(3 cos2(x)−1) 2 √ cos(x)−cos3(x) 1 x Mathematica Output: 2x 3(x2)2/3 −Sin[x]+3Cos[x]2Sin[x] 2 √ Cos[x]−Cos[x]3 1 x SageMath Output: 2x 3(x2) 2 3 3 cos(x)2 sin(x)−sin(x) 2 √ − cos(x)3+cos(x) 1 x SymPy Output: 2 3√x 2 3x 3 sin(x) cos2(x) x − sin(x) 2√ − cos3(x)+cos(x) 1 x GG (CAS V.) Output: 2 · 3√x 2 3x 1 2 · − sin(x)+3 cos2(x) sin(x)√ cos(x)−cos3(x) 1 x GG (Alg. V.) Output: 2 · 3√x 2 3x 1 2 · − sin(x)+3 cos2(x) sin(x)√ cos(x)−cos3(x) 1 x Maple perfectly describes the derivative of f (x), independently of the way it is introduced (a or b). Nevertheless, the derivative of |x| is returned in a strange but correct (and working) way: abs(1, x) (meaning “first derivative” of abs(x), although it would be more intuitive to return it as a piecewise function). The derivatives of g(x) and h(x) are correct. Derive incorrectly returns IF(x < 1, 0, 2·x) as the derivative of f (x) (the derivative at 1 is undefined, it isn’t 2·x). The derivative of |x| is returned using function SIGN(x), although it would be more intuitive Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1750 to return it as the function S(x) =  −1, if x < 0 ±1, if x = 0 1, if x > 0 (the ±1 probably tries to represent the two different one-sided derivatives at 1). The derivative of g(x) is correct (in this output an unexpected |x| appears instead of x; we suspect that the objective is to avoid what happens in Maple with x 2 3 happening—see Section 2.3). In the derivative of h(x) the function SIGN(x) is used again. Maxima and Wolfram Alpha can’t compute derivatives of piecewise functions. The derivatives of |x|, g(x) and h(x) are correct. Mathematica returns the derivative of f (x) as a piecewise function, but, surprisingly, says: “Indeterminate when True” instead of “when x = 1” (see Section 6). The derivatives of |x|, g(x) and h(x) are correct. SageMath Cell Server correctly returns the derivative of f (x), but SageMath 8.3 output is a surprise: it returns as derivative of f (x): (0, 0, 0)*D[0]piecewise(x|–>-2 on (-oo, 1), x|–>xˆ2 on 1,x|–>xˆ2 on (1, +oo); x) + D[1]piecewise(x|–>-2 on (-oo, 1),x|–>xˆ2 on 1, x|–>xˆ2 on (1, +oo); x) In SymPy there are two possible syntaxes (except for the piecewise function) • f=expression in x • def f(x): return expression in x that are evaluated, respectively, as follows: • f.subs(x,a) • f(a). The square root function also admits two forms sympy.sqrt(x) and x**sympy.Rational(1,2). However, the derivative obtained is the same in all cases. Both GeoGebra CAS View and GeoGebra Algebra View make exactly the same mistake as Derive when computing the derivative of f (x) (although, surprisingly, the format of the output of the two “Views” is different). The derivatives of |x|, g(x) and h(x) are correct. 4.2. Evaluating at a conflicting point the derivative function obtained (output) Tables 3–5 collect the output obtained when evaluating the derivatives of the five chosen functions at the conflicting points in the selected CASs. The output are commented in detail after Table 5. Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1751 Table 3. Output obtained when evaluating the derivative function of the functions f (x) and |x| in the different CAS selected at the conflicting point. SymPy’s output “NaN” means “Not a Number”. f (x) = −2 x < 1 x2 x ≥ 1 |x| Maple Output a:  0 1 < 1 undefined 1 = 1 2x 1 < 1 abs(1,0) Output b: undefined Error, (in simpl/abs) abs is not differentiable at 0 Derive Output: 2 ±1 Maxima Output: Maxima can’t compute them expt: undefined: 0 to a negative exponent. Wolfram Alpha Output: Wolfram Alpha can’t compute them Indeterminate Mathematica Output: Indeterminate Indeterminate SageMath Output: 2 power::eval(): division by zero SymPy Output: 2 NaN GG (CAS V.) Output: 2 ? GG (Alg. V.) Output: 2 ? Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1752 Table 4. Output obtained when evaluating the derivative function of the function g(x) in the different CAS selected at the conflicting point. g(x) = 3√ x2 Maple Output a: Error, numeric exception: division by zero Output b: Error, (in d) numeric exception: division by zero Derive Output: (±1)4/3 · (±1)5/3 Maxima Output: expt: undefined: 0 to a negative exponent. Wolfram Alpha Output: Indeterminate Mathematica Output: Indeterminate SageMath Output: power::eval(): division by zero SymPy Output: NaN GG (CAS V.) Output: ? GG (Alg. V.) Output: ? Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1753 Table 5. Output obtained when evaluating the derivative function of the functions h(x) and ln(x) in the different CAS selected at the conflicting point. h(x) = √ cos x − cos3 x ln x Maple Output a: Error, numeric exception: Error, numeric exception: division by zero division by zero Output b: Error, (in d) numeric exception: Error, (in d) numeric exception: division by zero division by zero Derive Output: ±1 ±∞ Maxima Output: expt: undefined: expt: undefined: 0 to a negative exponent. 0 to a negative exponent. Wolfram Alpha Output: Indeterminate ∞̃ Mathematica Output: Indeterminate Infinite expression 1 0 encountered ComplexInfinity SageMath Output: power::eval(): division by zero power::eval(): division by zero SymPy Output: NaN ∞̃ GG (CAS V.) Output: ? ? GG (Alg. V.) Output: ? ∞ Maple (output corresponding to “Input a”): it returns the value of the derivative of f (x) at 1 as a piecewise function, and says, strangely, things like “0 when 1 < 1” (that can never hold). The value of the derivative of |x| at 0 is returned in a strange but correct way: abs(1, 0) (if Maple is forced to evaluate this expression at 0, the message “Error, (in simpl/abs) abs is not differentiable at 0” is obtained). The values at 0 of the derivatives of g(x), h(x) and ln(x) are correct (error messages are returned). Maple (output corresponding to “Input b”): it returns the value of the derivative of f (x) at 0 as “Undefined”, which is correct. The value of the derivative of |x|, g(x), h(x) and ln(x) at 0 are correct (error messages are returned). An explanation on Maple’s “Input a” and “Input b” can be found in Appendix C. Derive incorrectly returns 2 as the value of the derivative of f (x) at 0. The value of the derivative of |x| at 0 is returned as ±1 (as if it was computed using one-sided derivatives). The values of the derivatives of g(x) and h(x) at 0 are also strange. The value ±∞ of the derivative of ln(x) at 0 if considered as a function of one real variable isn’t correct. Maxima can’t compute derivatives of piecewise functions, so it can’t compute the value of the derivative of f (x) at 0. The values of the derivatives of |x|, g(x) and h(x) at 0 are correct (error messages Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1754 are returned). Mathematica returns “Indeterminate” in all cases except ln(x), which is correct. Wolfram Alpha returns “Indeterminate” for |x|, g(x) and h(x), which is correct. SymPy and Wolfram Alpha return ∞̃ as the value of the derivative of ln(x) at 0 (complex infinity). This happens because they are considering the function as a complex-valued one. Something similar happens in Mathematica. The output isn’t formally correct. SageMath incorrectly returns 2 as the value of the derivative of f (x) at 0. The value of the derivatives of |x|, g(x), h(x) and ln(x) at 0 are considered as an error (division by 0). In SymPy the value of the derivative function at a point can be calculated in two ways: • using sympy.diff(f,x), and evaluating it at a using sympy.diff(f,x).subs(x,a) • using sympy.Derivative(f,x).doit() but the values obtained are the same in all cases. Both GeoGebra CAS View and GeoGebra Algebra View make exactly the same mistake as Derive when computing the derivative of f (x), and, consequently, when evaluating it at 0. They return “?” as the value at 0 of the derivatives of |x|, g(x) and h(x), which is correct. 5. Results: Approach II (using the mathematical definition of one-sided limits and the CASs one-sided limits calculation capability) 5.1. Computing the derivative and one-sided derivatives of the five chosen functions at the conflicting point using the mathematical definition and the CASs capability to compute limits and one-sided limits (output) Tables 6 and 7 collect the output of directly applying the formal definition of derivative and one- sided derivatives to the first four of the five chosen functions at the conflicting points using the selected CASs. Note that computing the derivatives and one-sided derivatives of ln(x) at 0 make no sense as this function isn’t defined at 0. The derivative at the conflicting point should return an error (or something like “undefined” or “?”) for all the chosen functions. All Maple output are correct. “Undefined” is used to represent the non-existence of the derivative at the conflicting point. Derive returns the derivative of |x|, g(x) and h(x) at the conflicting point with a ± symbol (what possibly isn’t the best solution). It is also noticeable that ∞ really represents +∞. The one-sided derivatives are correctly evaluated at the conflicting points. Maxima can’t compute derivatives of piecewise functions, so it can’t evaluate the derivative of the piecewise function. The values of the derivatives and one-sided derivatives of |x| and h(x) are correctly evaluated at the conflicting points (“und” represents “undefined”). In the case of g(x) it is strange that “und” isn’t obtained when evaluating the derivative at the conflicting point (moreover, the output obtained is “infinity”, that seems to correspond with Derive’s ±∞). The one-sided derivatives are correctly evaluated at the conflicting points (as happens in Derive,∞ really represents +∞). Wolfram Alpha can’t compute derivatives of piecewise functions. The values of the derivatives and one-sided derivatives of |x|, g(x) and h(x) are correctly evaluated at the conflicting points. Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1755 All Mathematica output are correct. “Indeterminate” is used to represent the non-existence of the derivative at the conflicting point. SageMath has a common interface functionality, and it can call GAP, Maxima, Python, etc., so it could have several outputs. It distinguishes between∞, +∞ and −∞ when it computes some limits. SymPy wrongly evaluates the derivative at the conflicting points for the four functions, returning in all cases the right-sided derivative at these points. The derivatives and one-sided derivatives of f (x) and |x| at the conflicting point are correctly ad- dressed by both GeoGebra CAS View and GeoGebra Algebra View. The symbol “?” is used to represent the non-existence of the derivative at the conflicting point. However there are errors when computing the derivatives at the conflicting points of g(x) and h(x). Moreover, there are errors when evaluating the one-sided derivatives of g(x) at the conflicting point (and one of the values is different in the two “Views”)! Table 6. Output obtained when computing the derivatives and one-sided derivatives of f (x) at 1 and of |x| at 0 using the mathematical definition. f (x) = −2 x < 1 x2 x ≥ 1 |x| Maple Output (limit - left - right): undefined NA 2 undefined −1 1 Derive Output (limit - left - right): ? NA 2 ±1 −1 1 Maxima Output (limit - left - right): Maxima can’t compute them und −1 1 Wolfram Alpha Output (limit - left - right): Wolfram Alpha can’t compute them two-sided limit does not exist −1 1 Mathematica Output (limit - left - right): Indeterminate NA 2 Indeterminate −1 1 SageMath Output (limit - left - right): SageMath can’t compute them und −1 1 SymPy Output (limit - left - right): 2 NA 2 1 −1 1 GG (CAS V.) Output (limit - left - right): ? NA 2 ? −1 1 GG (Alg. V.) Output (limit - left - right): ? NA 2 ? −1 1 Remark 3: Note that “NA” (for “Not Applicable”) appears in all rows of the column corresponding to the left derivative of the piecewise function f (x) in Table 6. As there is a jump discontinuity at 1 and the function is right continuous, it makes no sense to compute the left derivative (if calculated, the value obtained should be∞). Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1756 Table 7. Output obtained when computing the derivatives and one-sided derivatives of g(x) and h(x) at 0 using the mathematical definition. g(x) = 3√ x2 h(x) = √ cos x − cos3 x Maple Output (limit - left - right):undefined −∞ ∞ undefined −1 1 Derive Output (limit - left - right):±∞ −∞ ∞ ±1 −1 1 Maxima Output (limit - left - right): infinity −∞ ∞ und −1 1 Wolfram Alpha Output (limit - left - right): two-sided limit does not exist −∞ ∞ two-sided limit does not exist −1 1 Mathematica Output (limit - left - right):Indeterminate −∞ ∞ Indeterminate −1 1 SageMath Output (limit - left - right):∞ −∞ +∞ und −1 1 SymPy Output (limit - left - right):oo −oo oo 1 −1 1 GG (CAS V.) Output (limit - left - right):? ? ? 1 −1 1 GG (Alg. V.) Output (limit - left - right):? ? ∞ 1 −1 1 6. Some curiosities about Mathematica notation and piecewise functions 6.1. Explanation of the case “Inderminate True” Let us recall the following Mathematica output, that can be found in Table 1:  0 x < 1 2x x > 1 Indeterminate True. According to [47], the reason is that “Mathematica resorts to evaluating conditions in turn, and taking the first one that is True”. The underlying idea is that there is always an output, without exceptions. So the output is correct, although in the mathematical usual notation the “True” would be an “Otherwise”. Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1757 6.2. Additional conditions in piecewise functions Another curious situation can be found in Figure 8. Function α(x) is defined in the interval (−1, 2] as follows (it is explicitly undefined in the rest of R \ (−1, 2]): α(x) =  2 −1 < x < 1 x2 − x 1 ≤ x ≤ 2 Undefined True In Out[1] in Figure 8 the function is apparently defined in the whole R. However, the output is correct, as it adds to all cases the common condition: i f ! (! − 1 < x < 1 && ! 1 ≤ x ≤ 2) that is, in a more usual mathematical notation: i f ¬(¬(−1 < x < 1) ∧ ¬(1 ≤ x ≤ 2)) that, according to the De Morgan laws is equivalent to: i f ((−1 < x < 1) ∨ (1 ≤ x ≤ 2)) so, really, the value −x + x2 is only assigned to α(x) when (1 ≤ x ≤ 2). Something similar happens with the derivative of α(x) (see Out[4] in Figure 8). Although correct, the output isn’t intuitively written. Again, the common condition i f ((−1 < x < 1) ∨ (1 ≤ x ≤ 2)) is added to the piecewise conditions, and therefore: • the first line is useless, as it is discarded by the common condition, • the common condition adds nothing to the second line, • the condition of the third line and the common condition are equivalent to 1 < x ≤ 2, • the fourth line is the “else” condition, as mentioned above. Therefore Out[4] is correct but unnecessarily cumbersome. It is clear that the plots of α(x) and its derivative are defined only in the interval (−1, 2] (see Figure 8). Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1758 Figure 8. An example in Mathematica of a piecewise function (in green) and its derivative (in red). 7. Conclusions Computer Algebra Systems (CASs) compute the derivative of real-valued functions of one real variable. However, it has been shown that there are sometimes problems at points where the value of the left derivative and the right derivative are different. We have analysed and compared how some of the best known CASs behave when addressing this issue. However, as CASs can compute one-sided limits, it has been shown how the problem can be by- passed computing the one-sided derivatives using their formal definition (what has also been analysed and compared for the selected CASs). A textbook will return the same results (or equivalent ones) when calculating the derivative and one-sided derivatives of a real-valued function, independently from the country where the book was written. The results we consider mathematically correct are detailed in Section 3.3. But, surprisingly, Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1759 the output of the CASs depend on the chosen CAS. They are sometimes difficult to understand and even sometimes wrong. Observe that we admit all forms of the output expressions if they are mathe- matically correct. As input we try to use the most intuitive (and correct) ones, although an expert in each particular CAS could perhaps find a more appropriate one sometimes. This is an important issue from the educational point of view. It has been shown that the outputs aren’t always accurate and sometimes are difficult to understand. Therefore a student learning differ- entiation on his/her own with the help of a CAS can face different problems: misconceptions, incorrect verification of exercises, surprising inconsistencies when checking the results with a colleague using a different CAS, etc. Although we use CASs in our classes and strongly support their use as a digital tool for the mathematics class, the teacher is irreplaceable. A future work is to study the output of the differentiation command when different alternative equiv- alent expressions of the chosen functions are given as input to the CASs chosen. 8. Disclaimer We have summarized the results in the tables to the best of our knowledge. We sincerely apol- ogize for any unwanted errors (due to our lack of experience in handling the CASs) or errata when transferring the data to the tables. Acknowledgments This work was partially supported by the research projects PGC2018-096509-B-I00 and PID2021- 122905NB-C21 (Government of Spain). We are very grateful to the reviewers for their very detailed comments and suggestions, that have helped to improve the paper. Conflict of interest The authors declare there are no conflicts of interest. References 1. E. Ferres-López, E. Roanes-Lozano, Una breve nota didáctica sobre la evaluación de funciones fuera de su dominio usando software matemático, Boletín de la Sociedad Puig Adam, 113 (2022), 71–80. 2. E. Ferres-López, E. Roanes-Lozano, A. Martínez-Zarzuelo, Limit calculation outside the domain of definition of real functions using computer algebra systems: an educational panoramic view, in Proceedings of the 27th Asian Technology Conference in Mathematics, (2022), 372–382. Available from: https://atcm.mathandtech.org/EP2022/regular/21979.pdf. 3. PlanetMath, One-sided derivatives, 2013. Available from: https://planetmath.org/onesidedderivatives. 4. B. Rubio, Funciones de Variable Real, Madrid, España, 2006. Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1760 5. K. R. Stromberg, An Introduction to Classical Real Analysis, AMS Clesea Publishing, Providence, RI, USA, 1981. 6. F. Sánchez, Apuntes de Cálculo I, (n.a.). Available from: http://matematicas.unex.es/ fsanchez/calculoI/. 7. R. J. Iraundegui, Descartes 2D—Existencia de la Derivada, (n.a.). Available from: http://recursostic.educacion.es/descartes/web/materiales_didacticos/Derivadas_y_derivadas_later- ales/derivadas3.htm. 8. J. A. Méndez Contreras, Utilización de Maple como apoyo a la matemática en el Bachillerato, Federación Española de Sociedades de Profesores de Matemáticas (FESPM), Colección Cuader- nos para el aula. Badajoz, Spain, 2002. 9. E. Ferres-López, E. R. Lozano, A. M. Zarzuelo, Approach to the one-sided differentiability concept with a computer algebra system from the point of view of mathematics education, in CADGME Conference—Digital Tools in Mathematics Education, Abstracts, (2022), 30–31. Avail- able from: https://drive.google.com/file/d/1qF4ceMg6gNklOPa1JVkgKND1dOqNmyka/view. 10. Wikipedia, List of computer algebra systems, 2022. Available from: https://en.wikipedia.org/wiki/List_of_computer_algebra_systems. 11. L. Bernardin, P. Chin, P. DeMarco, K. O. Geddes, D. E. G. Hare, K. M. Heal, et al., Maple Programming Guide, Maplesoft, Waterloo Maple Inc. Waterloo, Canada, 2020. Available from: https://www.maplesoft.com/documentation_center/Maple2021/ProgrammingGuide.pdf. 12. R. M. Corless, Essential Maple—An Introduction for Scientific Programmers, Springer, New York, NY, USA, 1995. https://doi.org/10.1007/978-1-4757-3985-5 13. Maplesoft, Maple User Manual, Maplesoft, Waterloo Maple Inc. Waterloo, ON, Canada, 2022. Available from: https://www.maplesoft.com/documentation_center/maple2022/UserManual.pdf. 14. E. Roanes-Macías, E. Roanes-Lozano, Cálculos Matemáticos por Ordenador con Maple V.5., Ed- itorial Rubiños-1890, Madrid, España, 1999. 15. J. R. Sendra, S. Pérez-Díaz, J. Sendra, C. Villarino, Introducción a la Computación Simbólica y Facilidades Maple, Ra-Ma, Madrid, España, 2012. 16. Maplesoft, Maple Product History, (n.a.). Available from: https://www.maplesoft.com/products/maple/history/. 17. Maplesoft, Geometry Homework Help: Use Maple 10 to help with your geometry homework and assignments, (n.a.). Available from: https://www.maplesoft.com/maple10/maple10_students- geometry.aspx. 18. B. Kutzler, V. Kokol-Voljc, Introduction to Derive 6, Kutzler & Kokol-Voljc OEG, Austria, 2003. 19. E. Roanes-Lozano, J. L. Galán-García, C. Solano-Macías, Some reflections about the success and impact of the computer algebra system Derive with a 10-year time perspective, Math. Comput. Sci., 13 (2019), 417–431. https://doi.org/10.1007/s11786-019-00404-9 20. Maxima—A Computer Algebra System, 2022. Available from: https://maxima.sourceforge.io/. 21. J. E. Villate, XMaxima Manual, 2006. Available from: https://maxima.sourceforge.io/docs/xmaxima/xmaxima.pdf. Electronic Research Archive Volume 31, Issue 3, 1737–1768. http://dx.doi.org/https://doi.org/10.1007/978-1-4757-3985-5 http://dx.doi.org/https://doi.org/10.1007/s11786-019-00404-9 1761 22. Wolfram Alpha, (n.a.). Available from: https://www.wolframalpha.com/. 23. J. B. Cassel, Wolfram|Alpha: a computational knowledge “Search” engine, in Google It (ed. N. Lee), (2016), 267–299. https://doi.org/10.1007/978-1-4939-6415-4_11 24. Wolfram Mathematica—Comparative Analysis, Computer Algebra Systems. Available from: https://www.wolfram.com/mathematica/analysis/content/ComputerAlgebraSystems.html. 25. J. A. Moraño-Fernández, L. M. Sánchez-Ruiz, Cálculo y Álgebra con Mathematica 10, Universitat Politècnica de València, Valencia, España, 2015. 26. Wolfram Language & System—Documentation Center. Available from: https://reference.wolfram.com/language/?source=nav. 27. Wolfram Mathematica—Fast introduction for math students, (n.a.). Available from: https://www.wolfram.com/language/fast-introduction-for-math-students/es/?source=footer. 28. Sage, Documentation, (n.a.). Available from: SageMath Documentation. https://doc.sagemath.org/. 29. The Sage Development Team, Sage Reference Manual, 2022. Available from: https://doc.sagemath.org/html/en/reference/index.html. 30. SymPy Documentation Release 1.10.1., 2022. Available from: https://github.com/sympy/sympy/releases. 31. GeoGebra Classic Manual, (n.a.). Available from: https://wiki.geogebra.org/en/Libro. 32. H. Kronk, Despite clearing 100 million users, GeoGebra remains true to its founder’s vi- sion, 2018. Available from: https://news.elearninginside.com/despite-clearing-100-million-users- geogebra-remains-true-to-its-founders-vision/. 33. REDUCE, What is REDUCE, (n.a.). Available from: https://reduce-algebra.sourceforge.io/. 34. G. Rayna, REDUCE—Software for Algebraic Computation, Springer-Verlag, New York, 1987. https://doi.org/10.1007/978-1-4612-4806-4 35. M. McCallum, F. Wright, Algebraic Computing with REDUCE, Oxford University Pres, Oxford, UK, 1991. 36. Axiom, The Scientific Computation System, 2015. Available from: bhttp://www.axiom- developer.org/. 37. XCAS Documentation, (n.a.). Available from: https://xcas.univ-grenoble- alpes.fr/documentation/EN.html. 38. D. R. Stoutemyer, Crimes and misdemeanors in the computer alge- bra trade, Not. Am. Math. Soc., 38 (1991), 778–785. Available from: https://www.ams.org/journals/notices/199109/199109FullIssue.pdf. 39. J. H. Davenport, The challenges of multivalued “Functions”, in Intelligent Computer Mathematics, (2010), 1–12. https://doi.org/10.1007/978-3-642-14128-7_1 40. R. M. Corless, D. J. Jeffrey, S. M. Watt, J. H. Davenport, “According to Abramowitz and Stegun” or arccoth needn’t be uncouth, ACM SIGSAM Bull., 34 (2000), 58–65. https://doi.org/10.1145/362001.362023 Electronic Research Archive Volume 31, Issue 3, 1737–1768. http://dx.doi.org/https://doi.org/10.1007/978-1-4939-6415-4_11 http://dx.doi.org/https://doi.org/10.1007/978-1-4612-4806-4 http://dx.doi.org/https://doi.org/10.1007/978-3-642-14128-7_1 http://dx.doi.org/https://doi.org/10.1145/362001.362023 1762 41. M. England, R. Bradford, J. H. Davenport, D. Wilson, Understanding branch cuts of ex- pressions, in International Conference on Intelligent Computer Mathematics, (2013), 136–151. https://doi.org/10.1007/978-3-642-39320-4_9 42. M. England, E. Cheb-Terrab, R. Bradford, J. H. Davenport, D. Wilson, Branch cuts in maple 17, ACM Commun. Comput. Algebra, 48 (2014), 24–27. https://doi.org/10.1145/2644288.2644293 43. H. Aslaksen, Can Your Computer Do Complex Analysis? Comput. Algebra Syst. Pract. Guide, (1999), 246–258. 44. M. J. Wester, A Critique of the Mathematical Abilities of CA Systems, Comput. Algebra Syst. Pract. Guide, 16 (1999), 25–60. 45. L. Bernardin, A review of symbolic solvers, ACM SIGSAM Bull., 30 (1996), 9–20. https://doi.org/10.1145/231191.231193 46. J. Monaghan, S. Sun, D. Tall, Construction of the limit concept with a computer algebra system, in Proceedings of the 18th Conference of the International Group for the Psychology of Mathematics Education, (1994), 279–286. Available from: https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=332da54b21d4ac7877121501 f8ce0cae6fe6a343. 47. Mathematica Stack Exchange, What does True mean in this case? 2007. Available from: https://mathematica.stackexchange.com/questions/155021/what-does-true-mean-in-this-case. Electronic Research Archive Volume 31, Issue 3, 1737–1768. http://dx.doi.org/https://doi.org/10.1007/978-3-642-39320-4_9 http://dx.doi.org/https://doi.org/10.1145/2644288.2644293 http://dx.doi.org/https://doi.org/10.1145/231191.231193 1763 Appendix Appendix A: Detail of the input (code) for defining the functions In Tables A1–A3 the input used to define the different functions in the selected CAS is detailed. We have considered it necessary to detail the input used, as a potential reader could try to reproduce the calculations using an alternative input, perhaps thus obtaining a different output. Table A1. Input used to define the functions f (x) and |x| in the different CAS selected. f (x) = −2 x < 1 x2 x ≥ 1 |x| Maple Input: f:=x->piecewise(x<1,-2,x>=1,xˆ2); abs(x); Derive Input: f(x):=IF(x<1, -2, xˆ2) ABS(x) Maxima Input: f(x):=if x<1 then -2 else xˆ2; abs(x); Wolfram Alpha Input: f(x)=Piecewise[{-2,x<1},{xˆ2,x>=1}] |x| Mathematica Input: f[x_]:=Piecewise[{{-2,x<1},{xˆ2,x>=1}}] Abs[x](1) SageMath Input: f = piecewise( [ [(-oo,1),-2], [[1,1],xˆ2], [(1,oo),xˆ2] ] )abs(x)(2) SymPy Input: f=sympy.Piecewise((-2,x<1),(x**2,x>=1)) sympy.Abs(x) GG (CAS V.) Input: f(x):=If(x<1,-2,xˆ2) |x| GG (Alg. V.) Input: f(x)=If(x<1,-2,xˆ2) |x| (1) In Mathematica the aware user would use RealAbs[x] instead, to let Mathematica know that the function is a real variable one. (2) SageMath would require a preamble: assume(x, ’real’) to let it know that the function is a real variable one. Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1764 Table A2. Input used to define the function g(x) in the different CAS selected. g(x) = 3√ x2 Maple Input: g:=x->(xˆ2)ˆ(1/3); Derive Input: g(x):=(xˆ2)ˆ(1/3) Maxima Input: g(x):=(xˆ2)ˆ(1/3); Wolfram Alpha Input: g(x)=Cbrt[xˆ2] Mathematica Input: g[x_]:=(xˆ2)ˆ(1/3) SageMath Input: g(x)=(xˆ2)ˆ(1/3) SymPy Input: g=(x**2)**sympy.Rational(1,3) GG (CAS V.) Input: g(x):=(xˆ2)ˆ(1/3) GG (Alg. V.) Input: g(x)=(xˆ2)ˆ(1/3) Table A3. Input used to define the functions h(x) and ln(x) in the different CAS selected. h(x) = √ cos x − cos3 x ln x Maple Input: h:=x->(cos(x)-cos(x)ˆ3)ˆ(1/2); ln(x); Derive Input: h(x):=(COS(x)-COS(x)ˆ3)ˆ(1/2) LN(x) Maxima Input: h(x):=(cos(x)-cos(x)ˆ3)ˆ(1/2); log(x); Wolfram Alpha Input: h(x)=Sqrt[cos x-(cos x)ˆ3] ln(x) Mathematica Input: h[x_]:=(Cos[x]-(Cos[x])ˆ3)ˆ(1/2) Log[x] SageMath Input: h(x)=(cos(x)-cos(x)ˆ3)ˆ(1/2) log(x) SymPy Input: h=(sympy.cos(x)-sympy.cos(x)**3)**sympy.Rational(1,2)sympy.log(x) GG (CAS V.) Input: h(x):=(cos(x)-cos(x)ˆ3)ˆ(1/2) ln(x) GG (Alg. V.) Input: h(x)=(cos(x)-cos(x)ˆ3)ˆ(1/2) ln(x) Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1765 Appendix B: Detail of the input (code) for computing the derivative function of |x| In Table B1 the input used for computing the derivative of |x| is shown, as illustration of how the derivative function has been computed in each selected CAS. Table B1. Input used to obtain the derivative function of |x| in the different CASs selected. Derivative of |x| Value at 0 Maple Input a: diff(abs(x),x); subs(x=0,%); Input b: d:=x_->eval(subs(x=x_,diff(abs(x),x))); d(0); Derive Input: d(x):= DIF(ABS(x),x) d(0) Maxima Input: d(x):=diff(abs(x),x); d(0); Wolfram Alpha Input: d(x)=D[|x|,x] d(x)=D[|x|,x], evaluate d(0) Mathematica Input: d[x_]:=RealAbs’[x] d[0] SageMath Input: d(x)=diff(abs(x),x) d(0) SymPy Input: d=sympy.diff(sympy.Abs(x),x) d.subs(x,0) GG (CAS V.) Input: d(x):=(abs(x))’ d(0) GG (Alg. V.) Input: d(x)=(abs(x))’ d(0) Appendix C: Some curiosities about the Maple input (code) for computing the derivative functions In Table B1 we include two different possible Maple inputs (this is needed for all the functions): • the first one without defining function d(x) (note that % denotes the previous output), called “Input a” in the tables; • the second one, defining defining function d(x), called “Input b” in the tables, that requires some knowledge of Maple. The reason is the following. The “intuitive assignment” to define, for example, d(x) = x2 d:=x->x^2: works as expected when computing d(2) d(2); 4 meanwhile the “intuitive assignment” to d(x) as the derivative of 1 3 x3 d:=x->diff(1/3*x^3,x): doesn’t work as expected Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1766 d(x); 3 x d(1); Error, (in d) invalid input: diff received 1, which is not valid for its 2nd argument because the derivative is computed with respect to a variable that is substituted for a numerical value before it gets evaluated. There are no notable problems when defining and evaluating the derivatives of the functions in the other chosen CASs. Appendix D: Computing the derivatives and one-sided derivatives of |x| at 0 using one-sided limits in the CAS selected (input) All the selected CASs can compute limits and one-sided limits. Therefore we can directly try to apply the formal definition of derivative and one-sided derivatives to the five chosen functions using the selected CASs. Tables D1–D3 collect the input for achieving it in the case of function |x| (as illustration). Table D1. Input used to obtain the derivatives of |x| at 0 using their formal definition and limits in the different CAS selected. Derivative of |x| at 0 as a limit Maple Input: limit((abs(h)-abs(0))/h,h=0); Derive Input: LIM((ABS(h)-ABS(0))/h,h,0) Maxima Input: limit((abs(h)-abs(0))/h,h,0); Wolfram Alpha Input: lim ((|x|-|0|)/h) as h->0 Mathematica Input: Limit[(RealAbs[h]-RealAbs[0])/h,h->0] SageMath Input: lim((d(x)-d(0))/(x-0),x=0) SymPy Input: sympy.limit((sympy.Abs(h)-sympy.Abs(0))/h,h,0) GG (CAS V.) Input: Limit((|h|-|0|)/h,0) GG (Alg. V.) Input: Limit((|h|-|0|)/h,0) Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1767 Table D2. Input used to obtain the left-side derivative of |x| at 0 using its formal definition and one-sided limits in the different CAS selected. Left derivative of |x| at 0 as a one-sided limit Maple Input: limit((abs(h)-abs(0))/h,h=0,left); Derive Input: LIM((ABS(h)-ABS(0))/h,h,0,-1) Maxima Input: limit((abs(h)-abs(0))/h,h,0,minus); Wolfram Alpha Input: lim ((|x|-|0|)/h) as h->0 from left Mathematica Input: Limit[(RealAbs[h]-RealAbs[0])/h,h->0,Direction->1] SageMath Input: lim((d(x)-d(0))/(x-0),x=0,dir=’-’) SymPy Input: sympy.limit((sympy.Abs(h)-sympy.Abs(0))/h,h,0,’-’) GG (CAS V.) Input: LimitBelow((|h|-|0|)/h,0) GG (Alg. V.) Input: LimitBelow((|h|-|0|)/h,0) Electronic Research Archive Volume 31, Issue 3, 1737–1768. 1768 Table D3. Input used to obtain the right-side derivative of |x| at 0 using its formal definition and one-sided limits in the different CAS selected. Right derivative of |x| at 0 as a one-sided limit Maple Input: limit((abs(h)-abs(0))/h,h=0,right); Derive Input: LIM((ABS(h)-ABS(0))/h,h,0,+1) Maxima Input: limit((abs(h)-abs(0))/h,h,0,plus); Wolfram Alpha Input: lim ((|x|-|0|)/h) as h->0 from right Mathematica Input: Limit[(RealAbs[h]-RealAbs[0])/h,h->0,Direction->-1] SageMath Input: lim((d(x)-d(0))/(x-0),x=0,dir=’+’) SymPy Input: sympy.limit((sympy.Abs(h)-sympy.Abs(0))/h,h,0,’+’) GG (CAS V.) Input: LimitAbove((|h|-|0|)/h,0) GG (Alg. V.) Input: LimitAbove((|h|-|0|)/h,0) © 2023 the Author(s), licensee AIMS Press. This is an open access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0) Electronic Research Archive Volume 31, Issue 3, 1737–1768. http://creativecommons.org/licenses/by/4.0 Introduction About CASs Characteristics of CASs The CAS selected Plotting real-valued functions of one real variable in CASs What do we expect from the CASs Design of the experiment Summary of the steps carried out with the functions Formal definitions The five functions chosen Function f(x) Absolute value function Function g(x) Function h(x) Natural logarithm function Why were these functions chosen Related works Results: Approach I (using the CASs symbolic differentiation capability) Derivative function computed for the five functions chosen (output) Evaluating at a conflicting point the derivative function obtained (output) Results: Approach II (using the mathematical definition of one-sided limits and the CASs one-sided limits calculation capability) Computing the derivative and one-sided derivatives of the five chosen functions at the conflicting point using the mathematical definition and the CASs capability to compute limits and one-sided limits (output) Some curiosities about Mathematica notation and piecewise functions Explanation of the case ``Inderminate True'' Additional conditions in piecewise functions Conclusions Disclaimer