Application of the Maxima in the Teaching of Science Subjects at Different Levels of Knowledge
Total Page:16
File Type:pdf, Size:1020Kb
Advances in Science and Technology Research Journal Volume 8, No. 24, Dec. 2014, pages 44–50 Original Article DOI: 10.12913/22998624/566 APPLICATION OF THE MAXIMA IN THE TEACHING OF SCIENCE SUBJECTS AT DIFFERENT LEVELS OF KNOWLEDGE Anna Makarewicz1 1 Department of Applied Mathematics, Lublin University of Technology, Nadbystrzycka 38, 20-618 Lublin, Poland, e-mail: [email protected] Received: 2014.10.18 ABSTRACT Accepted: 2014.11.12 In this paper I present a program Maxima, which is one of the best computer algebra Published: 2014.12.01 system (CAS). The program is easy to use and offers many possibilities. In the text the interface, basic commands, and various examples to facilitate complex calculations in almost every field of mathematics are preented. I prove that the program can be used in secondary schools, upper secondary schools and college. Program’s capabilities are presented, including, among others, differentiation and symbolic integration, symbol- ic solving equations (including differential), simplifying algebraic expressions, matrix operations, the possibility of drawing graphs of 2D / 3D and others. Keywords: computer program, numerical computation, symbolic computation, sym- bolic differentiation, symbolic integration, graph, graph three-dimensional, function. INTRODUCTION • symbolic solving equations (including differ- ential), Maxima is a computer program, performing • symbolic solving systems of equations, mathematical calculations, both symbolic and nu- • symbolic differentiation and integration, meric. The use of symbolic computation allows to • matrix operations, solve many mathematical problems in an accurate • drawing graphs of functions, manner. Maxima can work as a calculator, which • perform calculations in the field of probability can be used in secondary schools. It is able to theory, create very complex parametric function graphs, • define your own functions by the user, implicit function graphs and graphs of function • export of the results to the following formats: of several variables, (with such problems faced HTML, LaTeX, and graphic formats PNG, students of almost all departments), these are nec- PostScript. essary basics that form the base for further de- Thanks to William Schelter program is free. velopment and specialization in a specific area, Since then, the Maxima has been developing quite for example mechanics, electrical engineering, intensively in versions for Windows and Linux. computer science, construction, aviation, broadly Since version 5.101 program already contains understood technologies, etc. an integrated overlay wxMaxima (graphi- This program stems from program macsyma cal user interface), which provides bet- developed at the Massachusetts Institute of Tech- ter formatting mathematical formulas and nology for the Department of Energy. The soft- makes them easier to enter and modify. ware features include: Maxima is a simple and intuitive software. Learn- • performing numerical calculations with any ing the basics of the Maxima does not require a accuracy, large amount of time. Maxima facilitates better • simplifying algebraic expressions and trigono- and faster understanding of mathematics. It al- metric, lows you to experiment, consider a lot of alter- 44 Advances in Science and Technology Research Journal vol. 8 (23) 2014 native solutions and create visualization. It also • less than < helps to save time and to control and eliminate • greater than or equal to >= errors in solving complex accounting tasks. • less than or equal to <= • to assign a value : • defining a function := BASICS MAXIMA Constants: Maxima works at input %i and outputs %o. • %e – base of natural logarithm Inputs and outputs are numbered that in combina- • %i – the imaginary unit tion with the %i or %o creates a unique identifier. • %pi – π Maxima distinguishes quantity of letter, so the • inf – ∞ function f(x) and F(x) are not the same. Variable • minf – −∞ %i stores the result of the last command. • %gamma – Euler’s constant Each instruction must be completed: a semi- Example: colon (;) – displays the „result” or dollar ($) – do Let’s try to perform the first arithmetic opera- not display the result (but it is calculated). The tions (ie, Maxima will be used as a calculator) and program accepts standard arithmetic operators show the interface (Figure 1). that are intuitive, so that the program can be used Note that you can refer to the previous result as a better class of the calculator in secondary with % (percent), eg: schools: (%i4) % – 20; (33–20) • adding + (%o4) 13; • subtraction – • multiplication * You can also refer to any previous result, • dividing / which we received in a given session, which • exponentiation ^ or ** greatly facilitates the work and calculations. For • matrix multiplication . this purpose we use the term %o or %i. Let us see how this works in practice: Comparison operators are also intuitive: (%i5) %o2 * 3; (-10*3) • equality = (%o5) -30 • inequality <> (%i6) %o3 – %o4; (33–13) • greater than > (%o6) 20 Fig. 1. First arithmetic operations 45 Advances in Science and Technology Research Journal vol. 8 (23) 2014 To receive a number in decimal form, use the expression which is located before the comma. So function float, here is an example: far, Maxima was used as a better class of calcula- (%i1) float(2/7); tor. Now we will present what is beyond the reach (%o1) 0.28571428571429 of a calculator. Numerical calculations in Maxima can be performed with any precision, the command EXPRESSIONS fpprec: n will be performed with an accuracy of n-significant digits (standard setting fpprec: The program Maxima is possible to declare 16). We can also change the accuracy of the dis- algebraic expressions. You can save even the played results by typing fpprintprec: n, here is most complex expression-patterns. These ex- an example: pressions can be freely converted, and you can (%i1) float(23/112); find their values at certain, fixed parameter val- (%o1) 0.20535714285714 ues. Maxima has many features that allow modi- (%i2) fpprintprec:4$ fying, simplifying and developing expressions (%i3) float(23/1121); and these are the main problems of students (%o3) 0.021 from secondary schools. Thanks to Maxima, Maxima handles well with large numbers and they may check their thinking because Maxi- is better than the calculator. Let us try to calculate ma allows you to control the partial results and the 2128 and 30! Factorial operation is very dif- calculations and all the results are displayed in ficult to imagine, especially for high school stu- symbolic form which enables precise analysis of dents and ordinary calculators cannot handle such reasoning. Let us present selected functions on large numbers, Maxima by calculating “the facto- algebraic expressions: rial of any value” helps you to realize how much • ev(expression,condition) – modifies the ex- the number is changing under its influence, which pression based on a condition, greatly helps to develop student’s imagination. To • subst(b,a,expression) – after the command do this in Maxima, we write: variable a in the expression will be replaced by (%i1) 2 ^ 128; variable b, (%o1) 340282366920938463463374607431768 • expand(expression) – develops algebraic ex- 211456 pressions, (%i2) 30!; • ratsimp(expression) – simplifies algebraic ex- (%o2) 265252859812191058636308480000000 pressions, • radcan(expression) – simplifies expression, Operator ‘ (apostrophe) • factor(expression) – decomposes expression factors, Operator ‘ prohibits the calculation of the val- • trigexpand(expression) – develops trigono- ue of its argument. metric expression, Example: • trigreduce(expression), trigsimp(expression) – (%i1) diff(sin(x),x) simplifies trigonometric expression (%o1) cos(x) • rectform – shows the expression in the form (%i2) ’diff(sin(x),x); A + B i. (%o2) (sin(x)) • polarform – shows the complex expression in the polar form re iθ Symbolic calculations are very good and • logcontact – simplifies the expression such as useful, as during subsequent operations the log x + b log y. computer does not make the mistake associ- ated with an approximation of the number. Example: Nested mathematical operations are often so (%i1) expand((b+c)^5); // expands the expression complicated that it is impossible to estimate in brackets 5 4 2 3 3 2 4 5 it’s value. Then you can ask the program to (%o1) c +5*b*c +10*b *c +10*b *c +5*b *c+b give the approximate result of the calculation. Now we will factorize the expression by enter To get the value of the expression we place the the command: comma after it and call the command number. It (%i2) factor(%); requires the return of the approximate value of the (%o2) (c+b)5 46 Examples. Examples. Examples. 1. Let f(x) = xx be the function which derivative we try to calculate, then we obtain: 1. Let f(x) = xx be the function which derivative we try to calculate, then we obtain: 1. Let f(x) = xx be the function which derivative(%i1) we diff(x^x,x); try to calculate , then we obtain: (%i1) diff(x^x,x); (%i1) diff(x^x,x); (%o1) xx*(log(x)+1) x x (%o1) x *(log(x)+1) (%o1) x *(log(x)+1) 2. Let the function be given by f(x) = . Calculation derivative of the second degree in Maxima looks2. Le ast the follows: function be given by f(x) = sin () . Calculation derivative of the second degree in Maxima 2. Let the function be given by f(x) = . Calculation derivative of the second degree in Maxima • subst(b,a,expression) – after the command variable a in the expression will be replaced bysin () sin () looks as follows: • subst(b,a,expression)looks