Path: utzoo!attcan!uunet!samsung!olivea!orc!inews!mipos2!alexw From: alexw@mipos2.intel.com (Alex Witkowski) Newsgroups: comp.sys.handhelds Subject: Re: A strange feature (a bug?) Keywords: symbolic integration/differentation in DEG mode Message-ID: <355@inews.intel.com> Date: 10 Oct 90 18:30:50 GMT References: <1990Oct10.093506.8848@wuarchive.wustl.edu> <15930@shlump.nac.dec.com> <1990Oct10.152505.2903@wuarchive.wustl.edu> Sender: news@inews.intel.com Reply-To: alexw@mipos2.UUCP (Alex Witkowski) Organization: Microprocessor Component Group, Intel Corp., Santa Clara, CA Lines: 61 In article <1990Oct10.152505.2903@wuarchive.wustl.edu> hp48sx@wuarchive.wustl.edu (HP48SX Archive Maintainer) writes: >> >>>If I try to evaluate dX(sin(X)) then I get: >>>cos(x)*(dX(X)*(pi/180)) >>>/* if the factor pi/180 should be applied, then it should be multiplied >>> to the x in cox(x), but even this is not correct */ >>>further EVAL gives: >>>cos(X)*(pi/180) >>> THIS IS 100% CORRECT! This derivative can be performed using the chain rule that we learned in first year calculus: Y=sin(X) where X is in degrees Y=sin(X*pi/180) where X*pi/180 is radians dY/dX=dX((sin(X*pi/180))*dX(X*pi/180) =cos(X*pi/180)*pi/180 (radians) transforming back to degrees: =cos(X)*pi/180 >thus sin( 60deg ) = sin( pi/3 RAD ) >these two point are exactly at the same point on the curve, and thus >the derivative must also be the same. THIS IS WRONG! Remember that you are plotting on two different X co-ordinates. Look at the average slope of the sine curve from 0 to pi/2 (or 90 degrees). Whether in degrees or radians the function has the same value at both of the endpoints - 0 and 1. Thus the average slope is Dy/Dx or (1-0)/(Xf-0) or 1/Xf. That translates to 2/pi or ~0.636 for the curve plotted in radians, but it is 1/90 or ~0.011 for the curve plotted in degrees. The radians curve is just a compressed (by a factor of 180/pi) plot of the degrees curve so it no surprise (for some of us) that the ratio of these two average slopes is exactly pi/180. This is also true for instantaneous slopes as the HP-48SX calculated. > >I think that the error is because of the possibility of writing >trigonometric functions in terms of the exponential function need the >arguments of tr igonometric functions to be in radians. So if you are in >degress mode, then the argument of a trigonometric function is >considered to be a function (pi/180)* the argument. That is what the chain rule is for! > >and if you take the derivative of a function on a function, then you get >the outher functions derived times the inner derived. I am not sure if >the results are correect for non real numbers. Like complex numbers. Yes! That's the chain rule. Why not apply it to the problem as shown above? The chain rule is number system independent. As long as the functions you generate make sense with complex numbers and so do their derivatives this is not be a problem. > >Povl ------------------------------- Alex Witkowski Intel Corporation Santa Clara, CA 95051