People on this forum have been unbelievably helpful.
I am trying to write some worksheets to help flatten the learning curve for folks who are new to MAPLE. Trouble is, being not far from the newbie stage myself, I may very well be making significant mistakes about the capabilities of MAPLE and thus teaching people cumbersome and inefficient ways of doing things. With that in mind, if anyone has the time to critique the following, I would be most appreciative.
Our goal is to derive the formula

MAPLE tells us this is the correct formula

**> **

In general, angle addition formulae can be obtained by the *expand* operation, e. g.

**> **

In the case of the sine of the sum of two angles, we can obtain the *inverse* of expand by using *combine*

**> **

However, this does not work in the case of the tangent of a sum of angles

**> **

Let's see how we may derive from the identity tan(x) = Let's try this

**> **

That's not exactly what we want - we want one numerator and one denominator. Let's try this...

**> **

Much better. If we were doing this with a pencil and paper, we would at this point divide both the numerator and the denominator of *expr1* by . Unfortunately, MAPLE's automatic simplification makes this problematic, as shown below...

**> **

Not much help. What happened (I think) is that MAPLE looked at the expression on the right side of and said to herself "this clown is dividing top and bottom by the same amount so the value of the expression isn't changing. I think I'll throw him a curve by simply flipping the sign of both the numerator and the denominator". Which brings me to the next

*!!!!!QUIRK ALERT!!!!!*

If you have an expression like, for example, expr1:= , don't be too surprised to find that

numer(expr1) = -() and denom(expr1) = . This multiplying of both the numberator and denominator by -1 is apparently random and can be disconcerting when you first encounter it. In fact, a number of times I have constructued a worksheet in which the values of both numer() and denom() of an expression flipped between positive and negative each time I ran the worksheet, without my having made any changes to the worksheet! The good news is that if one is changed then so is the other so the value of numer()/denom() is unchanged.

Getting back to , MAPLE doesn't like double decker fractions and so simplifies them. Most of the time this is good but often when working with equations it would be helpful to temporarily turn off this sort of simplification but as far as I can see there is no way to do this. Because of this it will be necessary to independently consider the numerator and denominator of expr1.

**> **

let's divide both by

**> **

There you go again MAPLE, trying to be helpful and messing me up! After doing the division MAPLE simplified, giving me a fraction when I really wanted a sum. I repeat - it would be helpful to be able to turn off automatic simplification. Let's try again...

**> **

Much better. Now for the substitution equations. I just copied the first and than changed 4 occurances of 'a' to 'b'.

**> **

**> **

We can't use subs on den2. That's because s*in(a)/cos(a)* and *sin(b)/cos(b)* don't exist as seperate units in den2. We have to use algsubs, which is more sophisticated. Unfortunately, algsubs doesn't accept sets for its first argument, so we have to make 2 substitutions. It's not as cumbersome as it looks. I just copied the first 2 statements and then modified them. Notice how the second argument in the second call to algsubs is % rather than den2. (why?). See what happens in (12) if you get rid of the first *expand(%)* command.

**> **

any finally

**> **

If you're thinking "that's alot of work to solve a relatively simple problem" I would agree with you. For relatively simple manipulations the pencil and paper method is usually better. In fairness to MAPLE, let's see how it would have been done without all the false starts...

**> **

**> **

**> **

**> **

**> **

**> **

Using cut & paste it didn't take me too long to write the above stuff. Notice how the top and bottom of are the negative of what they were before. Go figure!

**> **

This post was generated using the MaplePrimes File Manager

View 2292_Tan(a+b).mw on MapleNet or Download 2292_Tan(a+b).mw

View file details