[2.11] Force Getnum() And Getdenom() To Return Correct Results With Part() - Texas Instruments TI-89 Tip List

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

Advertisement

If you write programs that manipulate symbolic expressions, you need to consider the domain of the
variables. For example, for x < 0,
3
1
= − ( −x )
2
x
If x = -1, then the first expression gives -i, and the second is i. Both expressions do not simplify to
x^(3/2), because the identity (x^a)^b = x^(a*b) is not true for non-integer exponents a and b.
You also need to consider the CAS' behavior for x^n when x = 0. For example:
0^n | n>0 = 0
0^n | n=0 = 1, with the warning 0^0 replaced by 1
0^n | n<0 = 0^undef
(Credit to Carlos Becker for straightening me out on this)

[2.11] Force getnum() and getdenom() to return correct results with part()

The part() function is used to return the parts of an expression. In some cases it does not return the
expected results. For example:
getnum(a/b)
return a as expected, and
getdenom(a/b)
returns b, as expected, and
part(tan
-1
(a/b),1)
returns a/b, again, as expected. But
getnum(part(tan
returns a/b, and
getdenom(part(tan
returns 1.
While it can be argued that this is mathematically correct, it is hardly useful. To force getnum() and
getdenom() to return the expected results, save the result of part() in a variable, the use the functions
on that variable.
part(tan(a/b),1)→temp
Then
getnum(temp)
3
2 $ i
and
-1
(a/b),1))
-1
(a/b),1))
1
x 3
2 = −x 3 $ i
2 - 6

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92+

Table of Contents