knowt logo

2. Elementary Concepts of Computer Algebra

2. Elementary Concepts of Computer Algebra

  • This chapter introduces a language that is used throughout the book to describe the concepts, examples, and algorithms of computer algebra.
  • The form of an MPL mathematical expression and what happens to it during the evaluation process are described in Sections 2.1 and 2.2.
    • In Section 2.3 we look at elementary MPL programs and give a case study.
    • Section 2.4 describes MPL lists and sets, which are two ways to represent collections of mathematical expressions.
  • MPL uses both mathematical symbolism and ordinary English when appropriate and is similar in spirit to real computer algebra languages.
    • The reader should be able to follow discussions in MPL.
  • The current state of language and system development is one reason.
    • There will be new computer systems in the future.
    • Each system has its strengths and weaknesses, as well as its own following among members of the technical community.
    • The nature of the mathematical knowledge in the system and the language facilities that are available to access and extend this knowledge distinguish the systems.
    • The organization of mathematical concepts and language structures do not differ from system to system at the basic level.
    • By using a generic pseudo-language we are able to emphasize the concepts of symbolic computation without being limited by the quirks and limitations of a particular language.
  • MPL provides a way to evaluate and compare computer systems and languages.
    • If you want to implement MPL concepts and operations in real software, you should read it with one or more computer algebra systems at your side.
    • MPL's style is similar to real software, but there are differences between it and real languages and subtle differences between the languages themselves.
  • It is important to have a clear understanding of the structure and meaning of mathematical expressions to use a computer algebra system effectively.
    • In this chapter and Chapter 3, mathematical expressions will be the focus since there is a lot to say about this subject.
    • Other elements of the MPL language are introduced in Chapter 4.
  • Let's look at the different forms an MPL expression can have.
  • MPL expressions are similar to ordinary mathematical symbolism with some allowance made to accommodate the need for more precision in a computational environment.
  • The software that performs the exact manipula tion of mathematical expressions must have the ability to do it.
    • Real floating point arithmetic, which is used by conventional programming languages for purely numerical work, involves round-off error and is not appropriate for most computer algebra computation.
    • Even the small numerical errors that are inevitable with floating point arithmetic can affect the mathematical properties of an expression.

  • The calculations are done using the ordinary rules.
  • Because a computer is a finite machine, there is a maximum number of digits allowed in a number.
    • This bound is usually large and rarely a limitation in applications.
  • A real number in MPL has a finite number of digits, a decimal point, and an optional power of 10.

  • Real floating point arithmetic is similar to real number arithmetic.
    • This mode of computation may involve a round-off error.
    • Some computer systems allow for choice of numerical precision.
  • The mathematical concept of a real number should not be confused with the definition of an MPL real number.
    • MPL real numbers have a finite number of digits, which makes them rational numbers in the mathematical sense.
  • All of the function forms are described below.
  • An English or Greek letter is the beginning of an identifier.
  • The characters allowed in an identifier name vary from system to system.
  • Parentheses are used in mathematics to change the structure of an expression.

  • There are reserved symbols.

  • There are reserved symbols in Maple, Mathematica, and MuPAD.
  • There are a few more reserved symbols.
  • Through the actions of the transformation rules, reserved symbols acquire mathematical meaning.

  • The meaning of mathematical functions is acquired through the transformation rules in the system.
    • Function transformations similar to the simplifications are obtained by most computer algebra systems.
  • A small number of mathematical operators are used in this book.

  • The function is not defined.
    • There are no transformation rules or other properties associated with the function in a computational setting.
    • dependency relationships are usually understood from a context.
    • In the computational setting, more precision is required, and undefined functions can be used to represent this dependency.
  • One use of the functions is in expressions.

  • Function forms are used in three ways.
  • The solution of a differential equation can be obtained with a Mathematica dialogue.
  • The brackets are used to represent function forms.
  • The arbitrary constant in the solution is represented by Mathematica.

  • The structure of an expression can be changed with parentheses.

  • Both sets and lists have different mathematical properties and are used in different ways.
    • The operations that are appropriate for each of them are described in Section 2.4.
  • There are lists and sets in most computer algebra languages.
  • An MPL is a valid mathematical expression that is formed using a number of variables.
  • A programming language structure that is used to organize data is an expression with appropriate operands for each operator.
  • An array is a data structure.
  • The Elementary Concepts of Computer Algebra balanced parentheses are valid.

  • Even for expressions as simple as those considered here, the rules for expressions are quite involved.
    • A precise listing of the rules is essential for the designer of a computer algebra system, who must determine which expressions are valid statements in a language.
  • Syntax rules are important for system design, but they are not essential to the understanding of computer algebra and are not addressed in this book.
    • We examine this topic in detail in Chapter 3 since an understanding of expression structure is essential for computer algebra programming.
  • All variables are initial symbols in MPL.
    • The assumption allows a variable to fulfill its traditional role as an indeterminate symbol in a mathematical expression.
  • The assignment operator is a colon followed by an equal sign, and the assignment statement has a variable form.
  • Two actions are caused by an assignment statement.
    • A new expression is given when the expression to the right of the assignment symbol is evaluated.
  • The variable is assigned to the left of the assignment symbol.
  • The assignment statements are provided in all computer algebra languages.
  • The role of mathematical expressions is one aspect of computer algebra programming that distinguishes it from conventional programming.

  • The description of the role of expressions is useful, but should not be taken literally.
  • The role of an expression can be determined by actions that have taken place in a computation.
  • In Maple and MuPAD, the assignment symbol is the colon followed by the equal sign.

  • A language may restrict the use of some expression types to certain contexts, but most computer algebra languages use expressions as both program statements and data objects.
  • The practice in some computer systems is to end each input statement by a colon.
    • The result of evaluating the preceding input expression is to the left of the centered expressions.
  • The notation used for MPL expressions is similar to the one used for input expressions.
    • It is difficult to read for large expressions.
    • The program statements and data objects described here can be used in ordinary mathematical notations such as 4The Maple, Mathematica and MuPAD.
    • The Macsyma system does not allow logical expressions as data objects.
  • The logical expression p and q, with p and q symbols, cannot be entered in the interactive mode.
  • The Mathematica system does not require a symbol at the end of an expression.
    • Most systems allow a choice of symbol to show or not show a result.
  • MPL is used for input to MPL dialogues and for statements, procedures, and examples that involve manipulation in a computational context.
    • Ordinary mathematical notation is used in some of these situations because MPL is unwieldy.
  • Ordinary mathematical notation is usually used in discussions that are not in a computational context.
    • The use of MPL notation in purely mathematical contexts is possible in some instances.
  • The reader can easily translate between the two notations.
  • An example shows how a sequence of operations in ordinary mathematical discourse can be translated into a sequence of statements in MPL.

  • Let's take a look at the MPL operations that produce the equations.
    • There are three operations required: a solution of a linear equation, a substitution and differentiations.

  • There are MPL manipulations that correspond to Equations.

  • MPL gives a way to express a sequence of symbolic calculations in a way that resembles the statements and operations in a real CAS.
    • We caution the reader not to take the input statements and outputs in the dialogues too literally.
    • The implementation of a dialogue in a real CAS language will vary from system to system.

  • Although this operator was not needed in the MPL dialogue, it is necessary to handle the various forms of input and output of the and Substitute operators.
  • The statements at the first two prompt are the same as those in the MPL dialogue, but Maple displays the results as assignments and displays the derivative with partial derivative notation.

  • At the fourth prompt, we enter an equation with a symbol on the left side.
    • Both sides of the equation First derivative, 2.1, are differentiated at the fifth prompt.
  • Since the left side of the equation is returned as a first derivative symbol, we get a little more than we expected.
  • The result shown in the dialogue is because Maple's subs operator replaces all occurrences of the first derivative symbol with Expression (2.13).
  • Maple's operator op can be used to select the right side of w and to apply the subs operator to the resulting expression.
  • The second derivative symbol on the left side of an equation is needed to get the MPL result.

  • Two equal signs are used for an equal sign in an equation, and the D operator is used for differentiation.
  • If we insist that the solution be displayed as an equation, we can use the part operator of Mathematica to get this form.

  • The expression (2.14) is selected by Part[Part[s,1],1] which defines the substitution.

  • At the third prompt, we use MuPAD's subs operator to replace the derivative diff(y(x),x) in the previous expression by the symbol Dy.
    • Even though MuPAD's solve operator can solve for other function forms, it cannot solve for the expression diff(y(x),x).
    • MuPAD's Solve operator solved the equation v2 for Dy at the fourth prompt.
    • Special solutions are not required in our dialogue.
  • Use a CAS's command to solve a differential equation, but don't use it to get the arbitrary constant in the solution.
    • An equation similar to Expression should be returned by the last statement in the dialogue.

  • The arbitrary constant is obtained in the solution of a differential equation.

  • This equation has a general solution that involves two arbitrary constants which are found by substituting the two initial conditions into both the general solution and its derivative and then solving the resulting system of linear equations.
  • The general solution to the differential equation can be found by giving an interactive dialogue in a CAS similar to the one in Figure which finds the general solution to the differential equation, sets up the equations for the arbitrary constants, solve for the arbitrary constants, and then substitute them back into the The general solution to the differential equation can be obtained using a CAS's command, but not the arbitrary constants.

  • The last statement should show the numerical values for the coefficients.

  • The evaluation of variables and operators that appear in an expression is one of the Elementary Concepts of Computer Algebra 2.
  • The evaluation of variables and operators is considered in this section.
    • Chapter 3 describes the expression structure.
  • Some examples of variable and operator evaluation can be seen in Figure 2.13.

  • Only one level of active assignments is used with single-level evaluation.

  • Two levels of assignments are used.
  • It is possible to suppress the evaluation of a variable.
    • The operation is marked in MPL by placing the variable or operator name in quotes.
    • Sometimes it is necessary to unassign or 2.2.

  • There are examples of variable and operator evaluation in the dialogue.

  • This usually involves the "obvious" simplification rules from algebra and trigonometry that remove extraneous symbols from an expression and transform it to a standard form.
  • There are 7 procedures in a CAS language that are similar to procedures in a conventional programming language.
    • Procedures are considered in Chapter 4.

  • Some examples of automatic simplification are shown in an MPL dialogue.
  • The expression has a 3 term at the right end.
  • The application of the commutative law of addition serves to put the result in a more readable form and contributes to the simplification process.

  • Since there is no consensus about which simplification rules should be included in automatic simplification, the process can vary from system to system.
  • When automatic simplification is suppressed, Figure 2.16 shows an interactive dialogue with the Macsyma system.
    • At the prompt, we assign an expression to U and turn off the automatic simplifier by assigning the value false to the variable simp.
    • It is difficult to interpret an expression that is so involved.
    • The automatic simplifier is turned back on at (c4) and we get a more reasonable form for the derivative.
  • In MPL, all expressions in dialogues and computer pro grams operate in the context of automatic simplification.
    • Before the operators are applied, all input operands are sim plified.
  • The result of evaluating an expression is easy to understand.
  • Figuring out which simplification rules are applied by the process and which are not is a good idea.
    • The exercises in this section can be used to explore the automatic simplification process.
  • The reordering process in MuPAD is similar to what is described here.
    • In Maple, the reordering process is handled in a different way.

  • An interactive dialogue with the Macsyma system shows what happens when simplification is suppressed.
  • In Chapter 3, we show how automatic simplification modifies expressions, which in turn leads to simpler programs.

  • Some of the power transformations are only valid in certain contexts.

  • Automatic simplification handles 0 and 0.

  • There are some "hidden"transformations that have been applied to the expressions.
  • The internal form used by the CAS is different from the displayed form.
    • The internal form can be determined using the operand selection operator.
  • If the terms in a sum or factors in a product are reordered as part of automatic simplification, consider a CAS such as Mathematica or MuPAD.
  • Try to figure out how the ordering process is carried out.
  • The book focuses on the design and implementation of mathematical programs.
  • The statements in the program can either be entered at a single prompt in the interactive mode or in a text file that is loaded into the system.
  • The program statements include mathematical expressions, assign ment statements, decision statements, iteration statements, and function and procedure definitions.
  • As with conventional programs, some statements serve as input state ments, some statements are for intermediate calculations for which the output is not displayed, and some statements serve as output statements that display the result of a computation.
  • The program is designed to perform a cal culation for a group of problems rather than a single problem.

  • We modify the program to allow a choice of mathe matical variable names and do not require that the dependent variable be 12Decision statements, iteration statements, and function and procedure definitions.

  • The first and second derivatives of an implicit function are obtained by an MPL mathematical program.

  • There is an MPL program that performs these calculations.
    • Some statements are terminated by a colon and some by a semicolon.
    • The statement that ends with a colon suppresses the display of the output, while the statement that ends with a semicolon displays the output.
    • Control of output display is allowed in most computer systems.
  • The output is suppressed by statements that are terminated with a semicolon.
  • The independent and dependent variables are served by the Elementary Concepts of Computer Algebra.

  • A more involved MPL program is used to get the change of form of a quadratic equation under the rotation of coordinate axes.

  • It is easy to determine the type of graph and some of its important features by using analytical geometry.
    • The analysis is more involved.

  • We describe two operators that are available in most computer algebra systems before giving a program that performs these calculations.

  • The value 5 is obtained by the outer application.
  • The assignment at line 1 contains the input to the program.
    • We allow both sides of the equation to contain terms of the polynomial and combine them using the Operand selection operator.
    • The equation is obtained from evaluating the expression in line 17.
  • The programs are not very advanced.
    • Other MPL mathematical operators and language features are introduced in later chapters.

  • The output of the program should be displayed without function forms that appear in the symbols.

  • At a point of intersection, the circle and line have derivatives that are negative and so they intersect at a right angle.

  • The differential equation for the orthogonal family can be obtained by replacing the derivative symbol with a negative reciprocal.

  • The general solution and solution for the constant were entered.
    • Give a program that finds the general solution to a linear differential equation and uses an initial condition to find the arbitrary constant.

  • The input to your program is similar to the Equations.

  • The first order linear differential equation which has the expression as a general solution is given in this problem.
  • Give a program that uses steps similar to the ones in this example to find the differential equation.

  • 2 are constants.
    • In this problem, we are given an expression in the form (2.41) and find a second order linear differential equation which has the expression as a general solution.
  • If you give a program that has an expression of the form Equation (2.41) as input, it will find the differential equation.
    • The approach is the same as 2.
  • The maximum and minimum values of a function of several variables can be found using the method of lagrange multipliers.
  • Give a program that finds the solution to the equations.

  • The sets and lists are used to represent the collections of mathematical expressions.
    • The operations that are applied to each of the sets and lists are described in this section.

  • The elements of a set are different.
  • A set cannot contain duplicate elements.
  • The order of expressions in a set is not significant in MPL.

  • Similar results can be obtained with the Maple system.
  • A list has two equations.
    • The empty list has no expressions.
  • The order of expressions is important.
  • There are elements that are allowed in a list.
  • In MPL, lists are used when the order of expressions is significant.
    • Figure 2.22 shows the effect of order on the substitution operation.
    • A list is used to indicate the order of substitution.

  • The evaluation process in computer systems is described.
    • Evaluation in Maple is described in Heal, Hansen, and Rickard.
    • Evaluation is described in Wolfram.
    • Evaluation in MuPAD is described.
    • 40.
  • The programming in Maple is described.
    • 69.
    • Wolfram Programming in MuPAD is described by Gerhard and his colleagues.
    • 40.
  • The set and set operations are described in two books.
  • The structure of mathematical expressions is the subject of this chapter.
  • Understanding the structure of the data objects in computer algebra is important for programming.
  • Section 3.1 introduces the concept of recursion and describes a number of ways it is used in mathematics.
  • Recursion's main role is to describe the structure of expressions.
    • This topic is covered in detail in Chapter 5 because it is an essential programming technique.
  • Two structural forms for mathematical ex pressions correspond to internal forms used by computer algebra systems before and after automatic simplification.
    • Four primitive operators give a way to analyze and construct expressions.
  • The recursion concept is a fundamental part of computer algebra.
  • Simplistic, substitution, factorization, solution of equations, differentiation, and integration are included in the recursive structure of mathematical expressions puter algebra.
    • In this section, we explain why recursion is important in the manipulation of expressions and give a brief introduction to it.

  • The approach is more than just another way to define the factorial operation, it suggests another way to implement the calculation.
    • First, consider a computation based on the non-recursive definition.
  • The procedure is described in the MPL notation and terminology throughout the book.
    • The examples in this section are simple enough to be understood without a detailed description of the language.
  • The terminology we use in the procedure is described here.
  • A procedure definition in MPL is similar to a function definition in a programming language.

  • Let's compare the iterative procedure to a factorial procedure.
  • The process is stopped when the calculation is reduced to zero.
    • There must be at least one or more terminated procedures.
  • There is more to this example than is shown, and the topic will be discussed in greater detail in Chapter 5.
  • The basicbuilding blocks of more involved mathematical expressions are the atomic expressions.
  • A compound expression is composed of an operator.
  • An operator's operand can be either an atomic expression or another compound expression.
    • Each operator can have more than one operand.

  • All compound expressions have a uniform structure thanks to this view of lists.
  • Definition 3.1 is a description of a mathematical expression since a compound expression is constructed with an operator and simpler expressions that are either compound expressions themselves oratomic expressions.
    • It may sound like we are using a definition that is not a true definition, but we will see that 3.
    • Recursive structure of mathematical expressions suggests that a recursive algorithm is appropriate for many mathematical operations.
  • In textbooks on computer science, the recursion concept is discussed, but not in textbooks on math.
    • When doing pencil and paper manipulation, you may find it surprising that you use recursion.
  • We first simplify the sum's operands.
  • The expression 3 is an atom.
  • Any mathematical operation that involves a systematic examination of all parts of an expression is most likely not.
  • There is a reasoncursion can arise in computer algebra.
  • The original problem can be transformed into another problem.
    • The process is repeated if the new problem involves the same operation.
  • The process is not finished since the integration is defined in terms of another integration.

  • Definition 3.1 does not give a scheme for linking a unique structure with an expression.
    • Understanding the relationships between operators and operands is important since mathematical expressions are the data objects in computer algebra programming.
    • Two views of expression structure are described in this section.
    • The conventional structure is similar to the structure in both mathematics and conventional programming languages.
    • The simplified structure is the second view and corresponds to the structure after simplification.
  • The first thing we want to do is focus on the expressions de scribed in the following definition.
  • U is a number.
  • There is a symbol.
  • The trans formation rules of elementary algebra allow us to manipulate the algebraic expressions.
    • Rule (3) requires that the operands of a compound algebraic expression are algebraic expressions.

  • Operators are used to describe expression structure.

  • Operators are classified according to their number of operands and location in an expression.
    • The unary postfix operator is the factorial operator.

2. Elementary Concepts of Computer Algebra

  • This chapter introduces a language that is used throughout the book to describe the concepts, examples, and algorithms of computer algebra.
  • The form of an MPL mathematical expression and what happens to it during the evaluation process are described in Sections 2.1 and 2.2.
    • In Section 2.3 we look at elementary MPL programs and give a case study.
    • Section 2.4 describes MPL lists and sets, which are two ways to represent collections of mathematical expressions.
  • MPL uses both mathematical symbolism and ordinary English when appropriate and is similar in spirit to real computer algebra languages.
    • The reader should be able to follow discussions in MPL.
  • The current state of language and system development is one reason.
    • There will be new computer systems in the future.
    • Each system has its strengths and weaknesses, as well as its own following among members of the technical community.
    • The nature of the mathematical knowledge in the system and the language facilities that are available to access and extend this knowledge distinguish the systems.
    • The organization of mathematical concepts and language structures do not differ from system to system at the basic level.
    • By using a generic pseudo-language we are able to emphasize the concepts of symbolic computation without being limited by the quirks and limitations of a particular language.
  • MPL provides a way to evaluate and compare computer systems and languages.
    • If you want to implement MPL concepts and operations in real software, you should read it with one or more computer algebra systems at your side.
    • MPL's style is similar to real software, but there are differences between it and real languages and subtle differences between the languages themselves.
  • It is important to have a clear understanding of the structure and meaning of mathematical expressions to use a computer algebra system effectively.
    • In this chapter and Chapter 3, mathematical expressions will be the focus since there is a lot to say about this subject.
    • Other elements of the MPL language are introduced in Chapter 4.
  • Let's look at the different forms an MPL expression can have.
  • MPL expressions are similar to ordinary mathematical symbolism with some allowance made to accommodate the need for more precision in a computational environment.
  • The software that performs the exact manipula tion of mathematical expressions must have the ability to do it.
    • Real floating point arithmetic, which is used by conventional programming languages for purely numerical work, involves round-off error and is not appropriate for most computer algebra computation.
    • Even the small numerical errors that are inevitable with floating point arithmetic can affect the mathematical properties of an expression.

  • The calculations are done using the ordinary rules.
  • Because a computer is a finite machine, there is a maximum number of digits allowed in a number.
    • This bound is usually large and rarely a limitation in applications.
  • A real number in MPL has a finite number of digits, a decimal point, and an optional power of 10.

  • Real floating point arithmetic is similar to real number arithmetic.
    • This mode of computation may involve a round-off error.
    • Some computer systems allow for choice of numerical precision.
  • The mathematical concept of a real number should not be confused with the definition of an MPL real number.
    • MPL real numbers have a finite number of digits, which makes them rational numbers in the mathematical sense.
  • All of the function forms are described below.
  • An English or Greek letter is the beginning of an identifier.
  • The characters allowed in an identifier name vary from system to system.
  • Parentheses are used in mathematics to change the structure of an expression.

  • There are reserved symbols.

  • There are reserved symbols in Maple, Mathematica, and MuPAD.
  • There are a few more reserved symbols.
  • Through the actions of the transformation rules, reserved symbols acquire mathematical meaning.

  • The meaning of mathematical functions is acquired through the transformation rules in the system.
    • Function transformations similar to the simplifications are obtained by most computer algebra systems.
  • A small number of mathematical operators are used in this book.

  • The function is not defined.
    • There are no transformation rules or other properties associated with the function in a computational setting.
    • dependency relationships are usually understood from a context.
    • In the computational setting, more precision is required, and undefined functions can be used to represent this dependency.
  • One use of the functions is in expressions.

  • Function forms are used in three ways.
  • The solution of a differential equation can be obtained with a Mathematica dialogue.
  • The brackets are used to represent function forms.
  • The arbitrary constant in the solution is represented by Mathematica.

  • The structure of an expression can be changed with parentheses.

  • Both sets and lists have different mathematical properties and are used in different ways.
    • The operations that are appropriate for each of them are described in Section 2.4.
  • There are lists and sets in most computer algebra languages.
  • An MPL is a valid mathematical expression that is formed using a number of variables.
  • A programming language structure that is used to organize data is an expression with appropriate operands for each operator.
  • An array is a data structure.
  • The Elementary Concepts of Computer Algebra balanced parentheses are valid.

  • Even for expressions as simple as those considered here, the rules for expressions are quite involved.
    • A precise listing of the rules is essential for the designer of a computer algebra system, who must determine which expressions are valid statements in a language.
  • Syntax rules are important for system design, but they are not essential to the understanding of computer algebra and are not addressed in this book.
    • We examine this topic in detail in Chapter 3 since an understanding of expression structure is essential for computer algebra programming.
  • All variables are initial symbols in MPL.
    • The assumption allows a variable to fulfill its traditional role as an indeterminate symbol in a mathematical expression.
  • The assignment operator is a colon followed by an equal sign, and the assignment statement has a variable form.
  • Two actions are caused by an assignment statement.
    • A new expression is given when the expression to the right of the assignment symbol is evaluated.
  • The variable is assigned to the left of the assignment symbol.
  • The assignment statements are provided in all computer algebra languages.
  • The role of mathematical expressions is one aspect of computer algebra programming that distinguishes it from conventional programming.

  • The description of the role of expressions is useful, but should not be taken literally.
  • The role of an expression can be determined by actions that have taken place in a computation.
  • In Maple and MuPAD, the assignment symbol is the colon followed by the equal sign.

  • A language may restrict the use of some expression types to certain contexts, but most computer algebra languages use expressions as both program statements and data objects.
  • The practice in some computer systems is to end each input statement by a colon.
    • The result of evaluating the preceding input expression is to the left of the centered expressions.
  • The notation used for MPL expressions is similar to the one used for input expressions.
    • It is difficult to read for large expressions.
    • The program statements and data objects described here can be used in ordinary mathematical notations such as 4The Maple, Mathematica and MuPAD.
    • The Macsyma system does not allow logical expressions as data objects.
  • The logical expression p and q, with p and q symbols, cannot be entered in the interactive mode.
  • The Mathematica system does not require a symbol at the end of an expression.
    • Most systems allow a choice of symbol to show or not show a result.
  • MPL is used for input to MPL dialogues and for statements, procedures, and examples that involve manipulation in a computational context.
    • Ordinary mathematical notation is used in some of these situations because MPL is unwieldy.
  • Ordinary mathematical notation is usually used in discussions that are not in a computational context.
    • The use of MPL notation in purely mathematical contexts is possible in some instances.
  • The reader can easily translate between the two notations.
  • An example shows how a sequence of operations in ordinary mathematical discourse can be translated into a sequence of statements in MPL.

  • Let's take a look at the MPL operations that produce the equations.
    • There are three operations required: a solution of a linear equation, a substitution and differentiations.

  • There are MPL manipulations that correspond to Equations.

  • MPL gives a way to express a sequence of symbolic calculations in a way that resembles the statements and operations in a real CAS.
    • We caution the reader not to take the input statements and outputs in the dialogues too literally.
    • The implementation of a dialogue in a real CAS language will vary from system to system.

  • Although this operator was not needed in the MPL dialogue, it is necessary to handle the various forms of input and output of the and Substitute operators.
  • The statements at the first two prompt are the same as those in the MPL dialogue, but Maple displays the results as assignments and displays the derivative with partial derivative notation.

  • At the fourth prompt, we enter an equation with a symbol on the left side.
    • Both sides of the equation First derivative, 2.1, are differentiated at the fifth prompt.
  • Since the left side of the equation is returned as a first derivative symbol, we get a little more than we expected.
  • The result shown in the dialogue is because Maple's subs operator replaces all occurrences of the first derivative symbol with Expression (2.13).
  • Maple's operator op can be used to select the right side of w and to apply the subs operator to the resulting expression.
  • The second derivative symbol on the left side of an equation is needed to get the MPL result.

  • Two equal signs are used for an equal sign in an equation, and the D operator is used for differentiation.
  • If we insist that the solution be displayed as an equation, we can use the part operator of Mathematica to get this form.

  • The expression (2.14) is selected by Part[Part[s,1],1] which defines the substitution.

  • At the third prompt, we use MuPAD's subs operator to replace the derivative diff(y(x),x) in the previous expression by the symbol Dy.
    • Even though MuPAD's solve operator can solve for other function forms, it cannot solve for the expression diff(y(x),x).
    • MuPAD's Solve operator solved the equation v2 for Dy at the fourth prompt.
    • Special solutions are not required in our dialogue.
  • Use a CAS's command to solve a differential equation, but don't use it to get the arbitrary constant in the solution.
    • An equation similar to Expression should be returned by the last statement in the dialogue.

  • The arbitrary constant is obtained in the solution of a differential equation.

  • This equation has a general solution that involves two arbitrary constants which are found by substituting the two initial conditions into both the general solution and its derivative and then solving the resulting system of linear equations.
  • The general solution to the differential equation can be found by giving an interactive dialogue in a CAS similar to the one in Figure which finds the general solution to the differential equation, sets up the equations for the arbitrary constants, solve for the arbitrary constants, and then substitute them back into the The general solution to the differential equation can be obtained using a CAS's command, but not the arbitrary constants.

  • The last statement should show the numerical values for the coefficients.

  • The evaluation of variables and operators that appear in an expression is one of the Elementary Concepts of Computer Algebra 2.
  • The evaluation of variables and operators is considered in this section.
    • Chapter 3 describes the expression structure.
  • Some examples of variable and operator evaluation can be seen in Figure 2.13.

  • Only one level of active assignments is used with single-level evaluation.

  • Two levels of assignments are used.
  • It is possible to suppress the evaluation of a variable.
    • The operation is marked in MPL by placing the variable or operator name in quotes.
    • Sometimes it is necessary to unassign or 2.2.

  • There are examples of variable and operator evaluation in the dialogue.

  • This usually involves the "obvious" simplification rules from algebra and trigonometry that remove extraneous symbols from an expression and transform it to a standard form.
  • There are 7 procedures in a CAS language that are similar to procedures in a conventional programming language.
    • Procedures are considered in Chapter 4.

  • Some examples of automatic simplification are shown in an MPL dialogue.
  • The expression has a 3 term at the right end.
  • The application of the commutative law of addition serves to put the result in a more readable form and contributes to the simplification process.

  • Since there is no consensus about which simplification rules should be included in automatic simplification, the process can vary from system to system.
  • When automatic simplification is suppressed, Figure 2.16 shows an interactive dialogue with the Macsyma system.
    • At the prompt, we assign an expression to U and turn off the automatic simplifier by assigning the value false to the variable simp.
    • It is difficult to interpret an expression that is so involved.
    • The automatic simplifier is turned back on at (c4) and we get a more reasonable form for the derivative.
  • In MPL, all expressions in dialogues and computer pro grams operate in the context of automatic simplification.
    • Before the operators are applied, all input operands are sim plified.
  • The result of evaluating an expression is easy to understand.
  • Figuring out which simplification rules are applied by the process and which are not is a good idea.
    • The exercises in this section can be used to explore the automatic simplification process.
  • The reordering process in MuPAD is similar to what is described here.
    • In Maple, the reordering process is handled in a different way.

  • An interactive dialogue with the Macsyma system shows what happens when simplification is suppressed.
  • In Chapter 3, we show how automatic simplification modifies expressions, which in turn leads to simpler programs.

  • Some of the power transformations are only valid in certain contexts.

  • Automatic simplification handles 0 and 0.

  • There are some "hidden"transformations that have been applied to the expressions.
  • The internal form used by the CAS is different from the displayed form.
    • The internal form can be determined using the operand selection operator.
  • If the terms in a sum or factors in a product are reordered as part of automatic simplification, consider a CAS such as Mathematica or MuPAD.
  • Try to figure out how the ordering process is carried out.
  • The book focuses on the design and implementation of mathematical programs.
  • The statements in the program can either be entered at a single prompt in the interactive mode or in a text file that is loaded into the system.
  • The program statements include mathematical expressions, assign ment statements, decision statements, iteration statements, and function and procedure definitions.
  • As with conventional programs, some statements serve as input state ments, some statements are for intermediate calculations for which the output is not displayed, and some statements serve as output statements that display the result of a computation.
  • The program is designed to perform a cal culation for a group of problems rather than a single problem.

  • We modify the program to allow a choice of mathe matical variable names and do not require that the dependent variable be 12Decision statements, iteration statements, and function and procedure definitions.

  • The first and second derivatives of an implicit function are obtained by an MPL mathematical program.

  • There is an MPL program that performs these calculations.
    • Some statements are terminated by a colon and some by a semicolon.
    • The statement that ends with a colon suppresses the display of the output, while the statement that ends with a semicolon displays the output.
    • Control of output display is allowed in most computer systems.
  • The output is suppressed by statements that are terminated with a semicolon.
  • The independent and dependent variables are served by the Elementary Concepts of Computer Algebra.

  • A more involved MPL program is used to get the change of form of a quadratic equation under the rotation of coordinate axes.

  • It is easy to determine the type of graph and some of its important features by using analytical geometry.
    • The analysis is more involved.

  • We describe two operators that are available in most computer algebra systems before giving a program that performs these calculations.

  • The value 5 is obtained by the outer application.
  • The assignment at line 1 contains the input to the program.
    • We allow both sides of the equation to contain terms of the polynomial and combine them using the Operand selection operator.
    • The equation is obtained from evaluating the expression in line 17.
  • The programs are not very advanced.
    • Other MPL mathematical operators and language features are introduced in later chapters.

  • The output of the program should be displayed without function forms that appear in the symbols.

  • At a point of intersection, the circle and line have derivatives that are negative and so they intersect at a right angle.

  • The differential equation for the orthogonal family can be obtained by replacing the derivative symbol with a negative reciprocal.

  • The general solution and solution for the constant were entered.
    • Give a program that finds the general solution to a linear differential equation and uses an initial condition to find the arbitrary constant.

  • The input to your program is similar to the Equations.

  • The first order linear differential equation which has the expression as a general solution is given in this problem.
  • Give a program that uses steps similar to the ones in this example to find the differential equation.

  • 2 are constants.
    • In this problem, we are given an expression in the form (2.41) and find a second order linear differential equation which has the expression as a general solution.
  • If you give a program that has an expression of the form Equation (2.41) as input, it will find the differential equation.
    • The approach is the same as 2.
  • The maximum and minimum values of a function of several variables can be found using the method of lagrange multipliers.
  • Give a program that finds the solution to the equations.

  • The sets and lists are used to represent the collections of mathematical expressions.
    • The operations that are applied to each of the sets and lists are described in this section.

  • The elements of a set are different.
  • A set cannot contain duplicate elements.
  • The order of expressions in a set is not significant in MPL.

  • Similar results can be obtained with the Maple system.
  • A list has two equations.
    • The empty list has no expressions.
  • The order of expressions is important.
  • There are elements that are allowed in a list.
  • In MPL, lists are used when the order of expressions is significant.
    • Figure 2.22 shows the effect of order on the substitution operation.
    • A list is used to indicate the order of substitution.

  • The evaluation process in computer systems is described.
    • Evaluation in Maple is described in Heal, Hansen, and Rickard.
    • Evaluation is described in Wolfram.
    • Evaluation in MuPAD is described.
    • 40.
  • The programming in Maple is described.
    • 69.
    • Wolfram Programming in MuPAD is described by Gerhard and his colleagues.
    • 40.
  • The set and set operations are described in two books.
  • The structure of mathematical expressions is the subject of this chapter.
  • Understanding the structure of the data objects in computer algebra is important for programming.
  • Section 3.1 introduces the concept of recursion and describes a number of ways it is used in mathematics.
  • Recursion's main role is to describe the structure of expressions.
    • This topic is covered in detail in Chapter 5 because it is an essential programming technique.
  • Two structural forms for mathematical ex pressions correspond to internal forms used by computer algebra systems before and after automatic simplification.
    • Four primitive operators give a way to analyze and construct expressions.
  • The recursion concept is a fundamental part of computer algebra.
  • Simplistic, substitution, factorization, solution of equations, differentiation, and integration are included in the recursive structure of mathematical expressions puter algebra.
    • In this section, we explain why recursion is important in the manipulation of expressions and give a brief introduction to it.

  • The approach is more than just another way to define the factorial operation, it suggests another way to implement the calculation.
    • First, consider a computation based on the non-recursive definition.
  • The procedure is described in the MPL notation and terminology throughout the book.
    • The examples in this section are simple enough to be understood without a detailed description of the language.
  • The terminology we use in the procedure is described here.
  • A procedure definition in MPL is similar to a function definition in a programming language.

  • Let's compare the iterative procedure to a factorial procedure.
  • The process is stopped when the calculation is reduced to zero.
    • There must be at least one or more terminated procedures.
  • There is more to this example than is shown, and the topic will be discussed in greater detail in Chapter 5.
  • The basicbuilding blocks of more involved mathematical expressions are the atomic expressions.
  • A compound expression is composed of an operator.
  • An operator's operand can be either an atomic expression or another compound expression.
    • Each operator can have more than one operand.

  • All compound expressions have a uniform structure thanks to this view of lists.
  • Definition 3.1 is a description of a mathematical expression since a compound expression is constructed with an operator and simpler expressions that are either compound expressions themselves oratomic expressions.
    • It may sound like we are using a definition that is not a true definition, but we will see that 3.
    • Recursive structure of mathematical expressions suggests that a recursive algorithm is appropriate for many mathematical operations.
  • In textbooks on computer science, the recursion concept is discussed, but not in textbooks on math.
    • When doing pencil and paper manipulation, you may find it surprising that you use recursion.
  • We first simplify the sum's operands.
  • The expression 3 is an atom.
  • Any mathematical operation that involves a systematic examination of all parts of an expression is most likely not.
  • There is a reasoncursion can arise in computer algebra.
  • The original problem can be transformed into another problem.
    • The process is repeated if the new problem involves the same operation.
  • The process is not finished since the integration is defined in terms of another integration.

  • Definition 3.1 does not give a scheme for linking a unique structure with an expression.
    • Understanding the relationships between operators and operands is important since mathematical expressions are the data objects in computer algebra programming.
    • Two views of expression structure are described in this section.
    • The conventional structure is similar to the structure in both mathematics and conventional programming languages.
    • The simplified structure is the second view and corresponds to the structure after simplification.
  • The first thing we want to do is focus on the expressions de scribed in the following definition.
  • U is a number.
  • There is a symbol.
  • The trans formation rules of elementary algebra allow us to manipulate the algebraic expressions.
    • Rule (3) requires that the operands of a compound algebraic expression are algebraic expressions.

  • Operators are used to describe expression structure.

  • Operators are classified according to their number of operands and location in an expression.
    • The unary postfix operator is the factorial operator.