CAS vs Plot  Printable Version + HP Forums (https://archived.hpcalc.org/museumforum) + Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum1.html) + Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum2.html) + Thread: CAS vs Plot (/thread65842.html) 
CAS vs Plot  Mike (Stgt)  11162004 Hi all! I am _not_ the mathematician so I need some help for following function I found in the CAS examples. SIN(X)^2On the emulated HP40 with CAS version 4 (4/27/2000) I get this result too (after TAN2SC and EXPAND). But if I plot this function it shows a square wave between 1 and 1. Question: CAS does not respect the sign?
Ciao.....Mike
Re: CAS vs Plot  Dave Shaffer (Arizona)  11162004 Mike, It depends on where the square should be on the top term. Is it (sin(x))^2 (i.e. the entire sin function that is squared) or sin (x^2) (i.e. the argument of the sin function that is squared)? If it is the first, then this set of trig functions does not even have to be evaluated! It reduces exactly to 1. Why? Well, you can express tan(x) as sin(x)/cos(x). If you do this, then everything cancels out. In the denominator square root, for instance, you'd get (leaving off the (x) arguments for ease of notation) sqrt( sin cos (sin/cos) ) = sqrt (sin^2 ) = sin Similarly, the top of your equation reduces first to sin^2/sin = sin
Leaving for the final step, sin/sin = 1
Re: CAS vs Plot  Mike (Stgt)  11162004 Thank you Dave for your investigation, but I am not convinced: in the denominator you may reduce to sqrt(sin^2) what is never negative due to square. Further reduction would be abs(sin). But as numerator you get after reduction sin^2/sin what keeps the sign of sin (even if you keep your fingers crossed <G>). So the overall reduction would be sin/abs(sin) what is 1 or 1 every now and again. So the plot on the HP40G revealed a nasty surprise (as ugly as sin or remissible peccadillo?) in it's own CAS. Bombs on Babylon! Mathematical gomorrah!! The 40G was made to use at school.
Ciao.....Mike (sinning, pondering, scapegoat) Edited: 16 Nov 2004, 11:05 a.m.
Re: CAS vs Plot  Mark A. Ordal  11182004 Mike says: "Thank you Dave for your investigation, but I am not convinced: in the denominator you may reduce to sqrt(sin^2) what is never negative due to square." NO! because sqrt(anything^2) = +/anything So, in the end, Mike's original expression reduces to *either* +1 or 1, depending on your choice of root. The "abs" function has no relevence here. (I am assuming that when Mike writes "SIN(X)^2" he means exactly thatnamely "(SIN(X))^2" which mathematicians prefer to write as "SIN^2(X)".)
Mark
Re: CAS vs Plot  Mike (Stgt)  11222004 Yep  you are correct! Now when I read sqrt(anything^2) = +/anythingI remember. How could I forget. So the correct answer would be sign(sin(x)) or abs(sin(x))/sin(x)?
Ciao.....Mike
