Ordering Variables in Expressions
Since addition and multiplication are commutative and associative, the terms of a sum and the factors of a product could be arranged in any order. However, the Derive normal form orders terms and factors in a certain way to aid the collection of similar terms and factors. For example, the similar terms of
5·y·x + 7 - 3·x·y
are much easier to find and collect if the terms are first rearranged as
5·x·y - 3·x·y + 7
The Options > Mode Settings > Output command3L4YH lets you control the ordering used to sort variables. This variable ordering has a strong influence on how the terms of a sum and the factors of a product are ordered.
Derive maintains a list of variables that specifies the ordering used to sort variables. The factory default variable order list consists of the variables x, y, and z in that order.
A variable on the list is more main than variables after it on the list or variables not on the list. A variable not on the list is less main than variables on the list or variables before it in alphabetical order. For example, x is more main than y, which is more main than a.
When an expression has more than one variable, the most main variable is called the primary variable. The next most main variable is called the secondary variable, and so on. For example, x is the primary variable of
2
5·a·x + x·y
y is the secondary variable, and a is the tertiary variable.
The coefficient of a product consists of those factors that do not contain the primary variable of the product. For example, if x is the primary variable of
2 5
3·a·x ·y
then 3·a·y^5 is the coefficient, and 3 is the numeric coefficient.
The ordering of the factors in a product is based solely on the bases of the factors; the exponents of the factors have no influence on the ordering. Bases of a product that consist of a variable on the order list are sorted in that order. For example,
z^2·x^3·y^5
displays as
2 3 5
z ·x ·y
and simplifies to
3 5 2
x ·y ·z
Bases of a product that consist of a variable not on the order list are sorted in alphabetical order before bases that consist of a variable on the order list and after the numeric coefficient of the product. For example,
z^3·b^2·a·2·x^5·c
displays as
3 2 5
z ·b ·a·2·x ·c
and simplifies to
2 5 3
2·a·b ·c·x ·z
When ordering the terms of a sum, terms that contain the primary variable come before terms free of the variable. Moreover, terms that contain the primary variable come before terms that contain that variable to a lower degree. For example,
5·y^3+2·x^2-3·a·x
displays as
3 2
5·y + 2·x - 3·a·x
and simplifies to
2 3
2·x - 3·a·x + 5·y
The coefficients of terms are used to break ties in the ordering of sums. The terms of the sum that do not contain the primary variable of the sum are ordered using their own primary variable.
Derive sometimes rearranges the terms of a sum to produce more attractive output by eliminating a leading minus sign or displaying the real part of a sum before the imaginary part. For example,
-x + y
simplifies to y−x.
Use the Options > Mode Settings > Output command3L4YH to change and/or rearrange the variables on the variable order list. This command displays the current list and invites you to make changes. Note that existing expressions must be resimplified to see the effect of changing the variable order list.
When a new variable ordering is entered, this command generates an expression of the form
VariableOrder := [x1, x2, ..., xn]
where x1, x2, ..., xn are variables. The variable ordering can also be changed by entering on the expression entry line an expression of the above form using upper and lower case for VariableOrder exactly as shown. [x, y, z] is the factory default variable order setting.
If changing the variable order list does not yield exactly the desired form for a simplified expression, you can rearrange the expression using the Edit > Expression command129EYT7.
Subexpressions are less likely to be expanded if their variables are least main. Similarly, ratios are least likely to be combined if variables in sums in their denominators are least main. Thus the ordering of variables can dramatically affect the conciseness of a simplified result and the time required to obtain it. For example, if x is more main than y (as it is by default),
(x + 1)^9 + y
simplifies to
9 8 7 6 5 4 3 2
x + 9x + 36x + 84x + 126x + 126x + 84x + 36x + 9x + y + 1
because the subexpression (x+1)^9 is expanded. However, if you change the variable order list to y,x,z using the assignment
VariableOrder := [y, x, z]
then
(x + 1)^9 + y
simplifies to
9
y + (x + 1)
because the subexpression (x+1)^9 is not expanded, thus giving a compact result that requires less time to compute. Before continuing, we recommend restoring the default Derive variable ordering by issuing the command
VariableOrder := [x, y, z]
Expression growth from an unfortunate ordering of variables can exhaust memory before a result is derived. If this occurs while simplifying a multivariate expression, change the ordering of the variables and try resimplifying the expression. Alternatively, use the Simplify > Variable Substitution commandGP2.L1 to interchange the names of the variables in the expression before resimplifying.
Created with the Personal Edition of HelpNDoc: Free EBook and documentation generator