Simplify trig functions

Author: Brett Sauerwein
Syntax: TSIMPLFY( expr )
Require: ****

Function Information

---------------------

This function simplifies messy trig expressions from the CAS into simpler results involving cosecant, secant, cotangent, arc secant and arc cosecant.

Make sure you run it once before archiving it. This function calls itself several times during the course of execution, so tSimplfy will have to be in the current folder.

Syntax

---------

tsimplfy(TRIG EXPR)

Examples of use

-----------------

Input: Output:

-----------------

tsimplfy(1/sin(2x),2x) csc(2x)

tsimplfy(1/(x*cos(ln(x))),ln(x)) sec(ln(x))/x

tsimplfy(2/tan(16x^2)^6,16x^2) 2 cot(16x^2)^6

More Examples & Screenshots

---------------------------------

According to the TI CAS After being sifted

 

 

 

 

Note: The "argument" you want in this case is sin(2t)-5. The argument is extraneous; it may help to substitute simpler arguments in when you enter expressions for tSimplfy. In most cases, should you enter the wrong argument, tSimplfy will return the original function with no changes. After a little practice, you'll quickly get the hang of what to type in for TRIG ARGUMENT.

 

 

  **

** This is based on the definition of arcsec provided in my calculus book. If your book selects a different definition, you're not going to get the results expected. If you e-mail me, however, I'll send you a modified version that works in the desired manner.

Limitations

-----------

Some cases exist where tSimplfy won't work, although the number of cases where it fails is reduced in every version. Sometimes tSimplfy returns results that won't match the answers in your book exactly; this is due to the way the CAS handles trig expressions and is not a problem with this function. Applying factor() to results may help simplify things.

Below is a list of expressions tSimplfy will not work on.

1) Any trig expression taken to a fractional power
2) Absolute values
3) natural logs

With the code as it is now, fractional powers are impossible to implement. Absolute values and natural logs could be implemented with a bit of work, but I doubt the demand is there. If it is let me know.

Revision History

-----------

Version 3.00:

-- MAJOR CHANGE - now only requires one argument. Thanks to Kevin Kofler for suggesting the code that makes this possible
-- Arc secant and arc cosecant features now REMOVED (let me know if you want them back)

Version 2.99:

-- Complete support for tangent
-- Code totally rewritten
-- Much faster execution
-- More compact code (only one function now)
-- Easier to use; no more fiddling with quotes and double plus and minus signs
-- Now supports arc secant, and arc cosecant
-- Supports nearly all expressions

Version 2.1:

-- Simplifies complicated expressions faster (hopefully)
-- Added a check to make sure sec, csc, and cot are undefined in current folder
-- Separate screenshots are now included in the zipfile! (Major change, I know)
-- Expanded on the documentation

Version 2:

-- Handles most expressions better
-- Now supports expressions such as 1/sin(x) - 1/cos(x)
-- Now works almost all of the time
-- Less prone to infinite loops
-- Handles more types of arguments
-- Handles tangent and cotangent much better

Version 1:

-- Initially released, on Sept 13, 2000

Planned improvements

---------

Fractional exponents may be implemented in the near future. If this change is made, execution will also be sped up considerably. Keep your eyes open for a possible C version of this program too.

History

---------

One of the biggest problems I've ever had with the 89/92 is that it doesn't recognize simple trigonometric identities such as 1/sin(x) = csc(x). You can define them as functions, which simplifies entries, but the calculator still returns sloppy answers. So I set about trying to rectify this problem using TI-BASIC.

What you have here is the result of my work so far.

Brett Sauerwein

03-2001