Question: How do I substitute for the denominator in an equasion?

Here is my worksheet code:

> f := theta -> (a*b)/sqrt(a^2*(sin(theta-Pi/4))^2+b^2*(cos(theta-Pi/4))^2)+c*cos(4*theta);

(1) ...

> simplify(f(theta));

(2) ...

 > subs(sqrt(a^2*(cos(theta+Pi/4))^2+b^2-b^2*(cos(theta+Pi/4))^2)=tmp,simplify(f(theta)));

(3) ...

 I'm not sure how to paste output from Maple into the forum, but basically, I am trying to simplify an equasion prior to implementation in (non-Maple) code.  So, I want to evaluate the common term that shows up in the numerator and the denominator of  (2), but when I plug that common term in with the "subs" command, it only substitutes the term in the numerator.  Did I do something wrong?  How can I plug in a substitution for both the numerator and the denominator?

 

Thanks for your help and pointers...

 --wpd

 

Please Wait...