[2.12] Testing Equivalence Of Symbolic Expressions - Texas Instruments TI-89 Tip List

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

returns a, and
getdenom(temp)
returns b.
(Credit to Frank Westlake)

[2.12] Testing equivalence of symbolic expressions

The CAS (computer algebra system) of the 89/92+ does the best it can, but it can return expressions in
unexpected forms. To test if two expressions expr1 and expr2 are equal, just try
expr1 - expr2
which will return 0 if the two expressions are equivalent, or
expr1 = expr2
which will return true if the expressions are equivalent.
These tests may fail even if the expressions are equivalent, if the CAS does not include the necessary
identities. As a last resort, you can calculate a numeric result for the two expressions, substituting
numbers for the variables. As an example, consider the trigonometric identity
✕ = tan −1 b a
where a and b are the sides of a right triangle. The CAS cannot recognize that these two equations are
equal, because, in general, the two arguments are not equal. However, executing
approx(tan(b/a)-sin(b/(√(a^2+b^2))))|a=2 and b=3
returns 0.0. This approach requires care, because it can indicate that expressions are equal when they
are not, or vice versa. For example, round-off errors in evaluating the functions may return a result that
is very small, but not zero. Further, you need to be careful in selecting the numbers to use for the
variables. These guidelines help somewhat:
1. Don't use 0 or 1. These cause sum and product terms to drop out when they should not.
2. Use numbers that are relatively prime. This prevents equality of specific ratios.
3. Don't use pi, fractions of pi, or multiples of pi for trigonometric expressions in radians. These
can cause trigonometric identities to return equal values when they are not, in general, equal.
Similarly, don't use even multiples of 90° for trigonometric functions in Degree mode.
4. Don't use integers, for the same reasons as 1 and 2 above.
5. Try using random numbers. In this case the condition would be ...)|a=rand() and b=rand().
Using this method repeatedly with the example above, I got several results of 0, but also
40E-15, -40E-15, 10E-15, and so on. If you use random numbers, make sure the numbers are
valid for the function arguments. See tip [6.20] for functions to generate random numbers in a
specific range.
6. Repeat the calculation with different values.
✕ = sin −1
b
and
a 2 +b 2
2 - 7

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92+

Table of Contents