Keywords

Subject Classifications:

1 Introduction

Computer Algebra Systems (CAS) such as WxMaxima, Mathematica, Maple, Sage and others are often used to support calculations and visualization in teaching mathematical subjects [2, 3, 9,10,11, 13]. This paper is intended as a follow-up of the article [12] on supporting higher mathematics education by dynamic visualization using CAS. The didactic value of using software supporting visualization in teaching higher mathematics is generally beyond doubt. For example, the ability to visualize 3D objects with options of dynamic plot and animation, with various options for colour and transparency selection, appears to be very useful didactic tool in teaching students more advanced mathematics topics. In paper [12] we presented 3D example (Example 1) of dynamic visualization primal simplex algorithm steps containing 3D feasible region, corner points, simplex path and level sets using Mathematica [6, 14]. Obtaining a comparable didactic effect without any specialized computer programs such as CAS, would be difficult if possible. In our opinion, it is much more difficult to assess the didactic value of the use of symbolic computing using CAS in teaching higher mathematics. Symbolic computation in CAS allow us to solve mathematics problems symbolically, check and trace our calculations done by hand and present the results in an attractive graphic form. However, it would be difficult to unequivocally answer the question of whether, from the didactic point of view, it is better to solve and present mathematical problems symbolically using CAS or present manual calculations on the board. It would probably be valuable to learn both approaches. In the 1990s, there was a discussion between Steven Krantz and Jerry Uhl about the relevance of teaching Calculus students with Mathematica as part of the Calculus & Mathematica project [4, 8]. In this discussion, the views of both sides were divided and there was no common consensus as to the advantage of one approach over the other. The discussion shows that the problem of evaluating an approach with or without CAS in teaching higher mathematics is not simple or unequivocal. It seems that the ability to use symbolic CAS calculations can be particularly useful in more advanced research problems carried out by students, for example as part of a diploma thesis. In this paper we present and discuss two didactic examples of advanced mathematical analysis problems in which we use symbolic calculations. These examples were prepared by us for students of Warsaw University of Life Science. We also present a didactic experiment with the participation of the Informatics and Econometric Faculty students in their first contact with CAS.

2 Example 1: Convex Programming

Convex programming is part of mathematical programming. This example was prepared for students of the Informatics and Econometric Faculty of Warsaw University of Life Sciences within the course of Mathematical Programming. We solved the following convex optimization problem with Mathematica:

find the global minimum value of the function \(\displaystyle f(x_1, x_2,x_3)=(x_1^2+x_2^2+x_3)e^{x_3}\) over the greatest set D, over which f is convex. Determine several examples of level sets of function f.

This approach based on the fact that for convex function defined on convex set, local minimum is a global minimum.

Theorem 1

(See [1]). Let S be a nonempty convex set in \(\mathbb {R}^n\), and let \(f: S\rightarrow \mathbb {R}\) be convex on S. Consider the problem to minimize f(x) subject to \(x \in S\). Suppose that \(x_0 \in S\) is a local optimal solution to the problem.

  1. 1.

    Then \(x_0\) is a global optimal solution.

  2. 2.

    If either \(x_0\) is a strict local minimum or f i s strictly convex, \(x_0\) is the unique global optimal solution and is also a strong local minimum.

Theorem 2

(See [1]). Let S be a nonempty open convex set in \(\mathbb {R}^n\), and let \(f: S \rightarrow \mathbb {R}\) be twice differentiable on S. If the Hessian matrix is positive definite at each point in S, f is strictly convex. Conversely, if f is strictly convex, the Hessian matrix is positive semidefinite at each point in S.

Theorem 3

(See [1]). Let D be a nonempty convex set in \(\displaystyle \mathbb {R}^n\), and let \(f: D\rightarrow \mathbb {R}\). Then f is convex if and only if \(\displaystyle {{\,\mathrm{epi}\,}}f =\{(x, x_{n+1})\in \mathbb {R}^{n+1}: x\in D, x_{n+1}\in \mathbb {R}, x_{n+1}\ge f(x)\}\) is a convex set.

Theorem 4

Let D be a nonempty closed convex set in \(\mathbb {R}^n\), \(S=\mathrm {int}D\ne \emptyset \), and let \(f: D \rightarrow \mathbb {R}\) be continuous on D and convex on S. Then f is convex on D.

Using Mathematica we can find the stationary points of f and the greatest set D, over which f is convex.

figure a

From the listing 2.1 we have that the only stationary point of f is \(P_0=(0, 0, -1)\). \(\displaystyle f(P_0)=f(0, 0, -1)=-\frac{1}{e}\)

figure b

From listing 2.2 we have:

\(\displaystyle H(x_1, x_2, x_3)= \left( \begin{array}{lll} 2e^{x_3} &{} 0 &{} 2 e^{x_3} x_1\\ 0 &{} 2 e^{x_3} &{} 2 e^{x_3}x_2\\ 2e^{x_3}x_1 &{} 2e^{x_3}x_2 &{} e^{x_3}(2+x_1^2+x_2^2+x_3) \end{array}\right) \)

and

\(\displaystyle H(P_0)=H(0, 0, -1)= \left( \begin{array}{lll} \frac{2}{e} &{} 0 &{} 0\\ 0 &{} \frac{2}{e} &{} 0\\ 0 &{} 0 &{} \frac{1}{e} \end{array}\right) \).

\(H(P_0)\) is positive definite, so in \(P_0\) f attains local strict minimum.

Now we will find all \(\displaystyle P = (x_1, x_2, x_3)\in \mathbb {R}^3\) such that Hessian Matrix of f \(H(x_1, x_2, x_3)\) is positive definite.

From Listing 2.2 we also have:

\(\displaystyle \left\{ \begin{array}{l} W_1(P)=2e^{x_3}>0\\ W_2(P)=4e^{2x_3}>0\\ W_3(P)= 4 e^{3 x_3} (2 - x_1^2 - x_2^2+x_3)>0 \end{array}\right\} \Leftrightarrow 2 - x_1^2 - x_2^2+x_3>0 \).

Let define function \(\displaystyle g(x_1, x_2)=x_1^2+x_2^2-2\) on \(\displaystyle \mathbb {R}^2\).

We can prove that g is strictly concave on \(\mathbb {R}^2\) directly from the definition of concave function.

figure c
figure d

From Listing 2.4 or 2.3 we have that:

\(g(\lambda x+(1-\lambda )y)< \lambda g(x)+(1-\lambda )g(y)\)

\(\text {for each}~x, y\in \mathbb {R}^2~\text {such that}~x\ne y~\text {and for each}~\lambda \in (0,1)\; (\mathbb {R}^2~\text {is convex set})\)

So the sets \(\displaystyle D= {{\,\mathrm{epi}\,}}\, g = \{(x_1, x_2, x_3)\in \mathbb {R}^3: x_3\ge x_1^2 + x_2^2-2\}\) and \(\displaystyle S= \mathrm {int}\,D = \{(x_1, x_2, x_3)\in \mathbb {R}^3: x_3> x_1^2 + x_2^2-2\}\) are convex (see Theorem 3). From Fig. 1 we can also conclude that the set D is concave.

Hence on the set \(\displaystyle S=\{(x_1, x_2, x_3)\in \mathbb {R}^3: x_3> x_1^2 + x_2^2-2\}\) Hessian of f is positive definite, hence the function f is strictly convex on S and from Theorem 4 we conclude that f is convex on the set \(\displaystyle D=\{(x_1, x_2, x_3)\in \mathbb {R}^3: x_3\ge x_1^2 + x_2^2-2\}\). Hence from the theorem 1, local strict minimum of f is also global strict minimum (the least value) of f on the set D.

Of course the calculations and simplifications in Listing 2.4 we can do by hand. Calculations in Mathematica or other CAS are only one option for checking our hand calculations.

So we get the finale answer: \(\displaystyle f_{\mathrm {min}} = f(0,0,-1)=-\frac{1}{e}\).

CAS allows us to solve problem symbolically and also visualise it. Since symbolic computations are performed in CAS, so visualisations are performed there as well.

Fig. 1.
figure 1

The set D

We show below dynamic plots presenting level sets of function f.

Fig. 2.
figure 2

Dynamic plots of the level surfaces of convex function f on the convex set D

Fig. 3.
figure 3

Plots of the level surfaces \(\{(x_1, x_2, x_3)\in \mathbb {R}^3: f(x_1,x_2,x_3)=c\}\) of convex function f on the convex set D: for \(c=5, -1/e+1/10, -1/e+1/100\)

Dynamic version of the Figs. 3, 2 can be found at:

https://drive.google.com/file/d/1F7xOQaU7YSN3ar-z12rDgZJAFj06aDdU/view?usp=sharing

3 The Didactic Experiment with Example 1

This experiment was carried out on in two independent groups of second-year students of the Informatics and Econometric Faculty of Warsaw University of Life Sciences within the course of Mathematical Programming. Students were after courses of one and multivariable analysis and linear algebra. As part of the mathematical programming course, students were acquainted with the basic definitions and theorems in the field of convex programming. The students declared that they had not had contact with the CAS symbolic calculations before. In the first group of 36 students the Example 1 (only in CAS version) was demonstrated to the students and discussed in detail by the lecture. The presentation together with the discussion lasted about 20 min. After the presentation, the students answered two questions.

  1. 1.

    Were the presented symbolic calculations in Mathematica helpful in understanding the example? They chose one of four options:

    1. a)

      they were not helpful,

    2. b)

      they were a bit helpful,

    3. c)

      they were helpful,

    4. d)

      they were very helpful.

  2. 2.

    Did the symbolic calculations demonstrated in this presentation broaden your knowledge of computational techniques? They chose one of four options:

    1. a)

      did not broaden

    2. b)

      did broaden a little,

    3. c)

      did broaden,

    4. d)

      did greatly broaden.

We received the following results. For the question 1.: 0% of the students chose the answer a), 44% answer b), 53% answer c) and 3% answer d). For the question 2.: 0% of the students chose the answer a), 61% answer b), 39% answer c) and 0% answer d).

In the second group of 25 students the Example 1 was presented in two versions. First, in a traditional way - with manual calculation without CAS, and then with the use of CAS. The presentation of each version together with the discussion lasted about 20 min. After these two presentations, the students were to refer to the following statement by selecting one of the sub-items.

Comparing the two presented versions of the solution of the Example 1, I think that:

  1. a)

    it should first of all get acquainted with the first version of the solution (without CAS) and getting acquainted only with the second version (with CAS) is not enough,

  2. b)

    it should first of all get acquainted with the second version of the solution (with CAS) and getting acquainted only with the first version (without CAS) is not enough,

  3. c)

    each of the presented versions of the solution is equally good and you only need to get acquainted with one of them,

  4. d)

    it should get acquainted with both versions of the solution and getting acquainted only with one of them is not enough,

  5. e)

    I cannot judge which version of the solution is good enough, I have no opinion on this.

We received the following result: 32% of the students chose sub-item a), 52% sub-item b), 0% sub-item c), 16% sub-item d) and 0% sub-item e).

Analysing the obtained percentages of answers in the first group of students, it is worth emphasising that in both questions (1 and 2), none of the students chose the answer a). All students found that the presented CAS example was in some way helpful in understanding the problem of convex programming as well as it broaden their knowledge about computational techniques to some extent. Most of the students (53%) found that the presentation with the use of CAS was significantly helpful in understanding the problem of convex programming. 39% of the students of the first group found that the presentation significantly broadened their knowledge of computational techniques. In the second group, students compared two approaches to solving the convex programming problem: without CAS and with CAS. Analysing the percentage of responses in this group of students, we can see that the majority of students (52%) decided that it should first of all get acquainted with the second version of the solution (with CAS) and getting acquainted only with the first version (without CAS) is not enough. It also seems important that none of the students of this group considered both versions to be equally good and it is enough to get acquainted with one of them (0% for answer c)). Given that this was the first contact of students of both groups with CAS methodology, the results of the experiment would suggest that supporting the teaching of higher mathematics through CAS programs with the use of symbolic computing may have significant educational value.

4 Example 2: Calculating Complex Integrals with Mathematica

In this example we present some our experiences in teaching elements of complex analysis students of Environmental Engineering Faculty of Warsaw University of Life Science. Complex analysis in this faculty was one of the parts of higher mathematics course. In the framework of this course complex potential fluid flow model in two dimensions was presented. To understand this model and to be able to solve connected with it tasks, the ability to calculate complex integrals along a curve is required, so in this course we spent some time practicing computing complex integrals ([5, 7]). Let us solve the following complex integral problem using Mathematica.

Is the following equation true? Justify the answer.

\(\displaystyle \int _{K_1}\bar{z} {{\,\mathrm{Re}\,}}z \,\mathrm {d}{z} = \int _{K_2}\bar{z} {{\,\mathrm{Re}\,}}z \,\mathrm {d}{z}\),

where \(\displaystyle K_1\) is a directed segments from point A to point B and \(\displaystyle K_2\) is a directed broken line ABC presented in Fig. 4.

Fig. 4.
figure 4

Directet segments \(\displaystyle K_1\) and \(\displaystyle K_2\)

Let’s note that the integrands in both integrals are the same. If the function \(\displaystyle f(z)= \bar{z} {{\,\mathrm{Re}\,}}z\) is holomorphic in simply connected region containing \(\displaystyle K_1\) and \(\displaystyle K_2\), then equation is true. Let’s see if Cauchy-Riemann conditions are satisfied for function f. We have:

$$\displaystyle f(z)=f(x+i y)=(x-i y)x=x^2-i xy=u(x,y)+i v(x,y),$$

where \(\displaystyle u(x,y)=x^2\) and \(\displaystyle v(x,y)=-x y\) are real and imaginary parts of function f respectively. Determining partial derivatives of functions u(xy) and v(xy) we get: \(\displaystyle \frac{\partial u}{\partial x}=2x\), \(\displaystyle \frac{\partial u}{\partial y}=0\), \(\displaystyle \frac{\partial v}{\partial x}=-y\), \(\displaystyle \frac{\partial u}{\partial y}=-x\). Both Cauchy-Riemann conditions: \(\displaystyle \frac{\partial u}{\partial x}= \frac{\partial v}{\partial y}\), \(\displaystyle \frac{\partial u}{\partial y}= -\frac{\partial v}{\partial x}\) are satisfied only in point B. So, function f is not holomorphic in any simple connected region containing \(\displaystyle K_1\) and \(\displaystyle K_2\). Let us calculate both integrals. Let’s use the following parametrizations of segments AB, AC and BC.

For AC: \(\displaystyle z_1(t)=t+i (t+1), \; t\in [-1, 0]\).

For AB: \(\displaystyle z_2(t)=t,\; t\in [-1, 0]\).

For BC: \(\displaystyle z_3(t)=i t,\; t\in [0, 1]\).

So, we get:

\(\displaystyle \int _{K_1}\bar{z} {{\,\mathrm{Re}\,}}z \,\mathrm {d}{z} = \int _{K_1}\bar{z}_1 {{\,\mathrm{Re}\,}}z_1 \,\mathrm {d}{z_1}= \int _{-1}^0[t-i(t+1)]t(1+i) \,\mathrm {d}{t}=(1+i)\int _{-1}^0[t^2- i(t^2+t)] \,\mathrm {d}{t}=(1+i)\Big [\frac{1-i}{3}t^3-\frac{i}{2}t^2\Big ]^0_{-1}=\frac{1}{6}+\frac{1}{2}i\).

\(\displaystyle \int _{K_2}\bar{z} {{\,\mathrm{Re}\,}}z \,\mathrm {d}{z}= \int _{AB}\bar{z} {{\,\mathrm{Re}\,}}z \,\mathrm {d}{z}+\int _{BC}\bar{z} {{\,\mathrm{Re}\,}}z \,\mathrm {d}{z}= \int _{AB}\bar{z}_2 {{\,\mathrm{Re}\,}}z_2 \,\mathrm {d}{z_2}+ \int _{BC}\bar{z}_3 {{\,\mathrm{Re}\,}}z_3 \,\mathrm {d}{z_3}= \int _{-1}^0t^2\,\mathrm {d}{t}+\int _0^1 0\,\mathrm {d}{t}=\frac{1}{3}\).

Finally: \(\displaystyle \int _{K_1}\bar{z} {{\,\mathrm{Re}\,}}z \,\mathrm {d}{z} = \frac{1}{6}+\frac{1}{2}i \ne \frac{1}{3}= \int _{K_2}\bar{z} {{\,\mathrm{Re}\,}}z \,\mathrm {d}{z}\). Equation is not true.

figure e
figure f
figure g
figure h

Note that the Mathematica program did not compute the indefinite complex integral of the function f(z). By examining the holomorphism of the function f(z), we showed that the result of the integration can depend on the curve along which we integrate, so it was necessary to calculate the integrals on both sides of the equality. Both of the integrals we calculated using Mathematica in two ways: parameterizing \(K_1\) and \(K_2\) and also directly - using the Integrate procedure for two points: \(-1\) and I or for three points: \(-1\), 0 and I.

5 Summary and Conclusions

This paper analyses the problem of supporting the teaching of higher mathematics with the help of symbolic computation using CAS. The article presents two original examples of supporting teaching advanced problems of mathematical analysis with the use of symbolic computation in CAS. It also includes a didactic experiment with the participation of the Informatics and Econometric Faculty students in their first contact with CAS. We have not encountered a similar approach to the analysis of this issue - based on didactic experiments, in the available literature.

Supporting the teaching of higher mathematics with the help of symbolic calculations using CAS programs is an alternative approach to the traditional method of calculations by hand for solving mathematical tasks and presenting calculations to students. The Example 1 presents a convex optimization problem solved step by step using Mathematica procedures. This example was presented to two groups of students as part of a didactic experiment carried out in Mathematical Programming class. In the first group, most of the students (53%) rated the presented symbolic calculations in Mathematica as helpful in understanding the example; 3% of students found the presentation very helpful and 44% a little helpful in understanding the example. All the students of the first group stated the presentation to some extent broadened their knowledge of computational computing techniques. In the second group, more than half of the students (52%) decided that it should first of all get acquainted with the version of the Example 1 using CAS and getting acquainted only with the version without CAS is not enough. The obtained percentage results of the student questionnaires seem to suggest that the use of symbolic calculations in CAS to solve the Example 1 was significantly helpful in understanding this example. The advantage of using the integrated CAS program environment for a symbolic solution of the task is the possibility of graphical illustration of the individual steps of symbolic calculations using graphical procedures of CAS programs. Nevertheless, independent use of the symbolic computational procedures of CAS programs by students to solve more advanced tasks in the field of higher mathematics requires not only a good knowledge of these programs but also a deep understanding of mathematical issues in the field of a given subject. The Example 2 shows that the “automatic” use of symbolic computational procedures in Mathematica does not make sure that this usage is fully correct and that the result obtained is correct. For example, without checking the holomorphicity in Example 2, we cannot know whether computing the complex integral from point to point in Mathematica, using the procedure Integrate depends or not on the curve along which we are integrating. The support of traditional methods of teaching mathematics with CAS programs is rather unobjectionable and is quite widely regarded as a useful didactic tool for teaching mathematics in various fields. Nevertheless, replacing traditional methods of teaching higher mathematics with CAS-based teaching is debatable, as shown by the discussion between Steven Krantz and Jerry Uhl [4, 8]. However, it seems that such controversy will not arise when students are taught both approaches independently with a collaborative orientation - supporting one approach over the other.