[OT] (Cos x)^x « Next Oldest | Next Newest »

 ▼ Chuck Senior Member Posts: 320 Threads: 59 Joined: Dec 2006 11-30-2007, 04:11 PM Getting my students ready for their calculus Final I had them differentiate y = (cos x)^x to find the slope when x=0. We then graphed the original function and analyzed all its behaviors (though not using calculus). Most calculators and computers had a difficult time producing an adequate graph of this. A good little exercise with a few suprises. ▼ Karl Schneider Posting Freak Posts: 1,792 Threads: 62 Joined: Jan 2005 12-01-2007, 12:47 AM Hi, Chuck -- This isn't really OT. I believe that you'd posted earlier this year about other math functions/calculations such as i^i. (cos x)x produces no real-valued result for non-integer values of x that give negative cosines (if I stated that right), which may account for the difficulty in computer plotting. I should try that on Matlab for practice; I haven't used it in a long while. For those who are interested, the derivative is (cos x)x [ln(cos x) - x tan x] (Very minor programming "challenge": Calculate the derivative function assuming a stack loaded with x (as with SOLVE or INTEG), without executing "cos x" twice and without using a storage register.) -- KS Edited: 1 Dec 2007, 4:00 p.m. after one or more responses were posted ▼ Chuck Senior Member Posts: 320 Threads: 59 Joined: Dec 2006 12-01-2007, 08:54 AM Hi Karl. It's actually defined when negative, as long as the values aren't complex. Also, it resembles secant for x<0. The spikes and "U"'s get narrower for large x's. Crazy function. Here's what I get with Mathematica. CHUCK Edited: 1 Dec 2007, 10:08 a.m. ▼ Karl Schneider Posting Freak Posts: 1,792 Threads: 62 Joined: Jan 2005 12-01-2007, 02:19 PM Hi, Chuck -- Thank you for the plot, which would be laborious to produce using an HP-15C and graph paper... Quote: It's actually defined when negative, as long as the values aren't complex. The function is defined continuously in the real domain for positive or negative x as long as "cos x" is positive. If "cos x" is negative, then only integer values of x can produce a real-valued result. Quote: Also, it resembles secant for x<0. Since cosine is "even", [cos x = cos(-x)], for negative x we can write (cos x)x = 1 / [(cos |x|)|x| Of course, sec x = 1 / cos x. Quote: The spikes and "U"'s get narrower for large x's. As expected, since larger exponents "reduce" smaller arguments. That is, xa < x for x < 1 and a > 1. I understand the solid lines of the plot, where the function has a real-valued result, but the dotted parts (e.g., between pi/2 < x < 3*pi/2) don't seem to represent Re[f(x)]. -- KS Edited: 1 Dec 2007, 3:35 p.m. ▼ Chuck Senior Member Posts: 320 Threads: 59 Joined: Dec 2006 12-01-2007, 08:45 PM The places where (Cos x)^x is negative is where the interesting pieces are. For my mathematica plot, I used a step size of 1/35 to "see" those parts. Depending on the numerator, the results will be either positive or negative (skipping over all of the complex results. For example ```F(71/35) = -0.190819 F(72/35) = 0.209171 and since 71/35 < 2.04 < 72/35 F(2.04) = .1965 + .0248i ``` Wherever F(X) is negative, the function will be everywhere discontinuous (however, infinite positive values, infinite negative, and infinite complex.) If you graph the function on the TI-84 and use "Zoom Decimal" you can get a fairly decent graph of this behavior. CHUCK Edited: 1 Dec 2007, 8:47 p.m. ▼ Karl Schneider Posting Freak Posts: 1,792 Threads: 62 Joined: Jan 2005 12-02-2007, 03:23 AM Chuck -- I'm beginning to understand the discontinuous portion of the plots. Quote: The places where (Cos x)^x is negative is where the interesting pieces are. The only negative real-valued results, it seems to me, are those for which (cos x) is negative, and x is an odd integer. E.g., f(3) = -0.970277. The two data points you listed (71/35 and 72/35) have only complex-valued function results. The magntitudes of those complex-valued solutions are equal to the values you listed. I'm not sure what determines why f(71/35) would be negative. -- KS Edited: 2 Dec 2007, 5:08 p.m. Stefan K. Junior Member Posts: 13 Threads: 2 Joined: Nov 2005 12-03-2007, 01:39 PM Quote: The function is defined continuously in the real domain for positive or negative x as long as "cos x" is positive. If "cos x" is negative, then only integer values of x can produce a real-valued result. Not only for real values, a^(-p/q)=1/a^(p/q) has also a real value for negative a (and integer p and q). Depending on odd or even p, the result is negative or positive. And since rational numbers are dense in the real space (and there are infinitely many of them in every interval), you see two branches whereever (cos q) is negative. Since computers don't know real real numbers... Stefan ▼ Karl Schneider Posting Freak Posts: 1,792 Threads: 62 Joined: Jan 2005 12-04-2007, 12:13 AM Aha! Thank you, Stefan, for clearing that up. Yes, I should have evaluated the powers (71, 72) and root (35) separately, using the HP-32SII for example. I wasn't seeing the true point of the rational input arguments, believing it to be just discretization for plotting. Also, I trust the HP-15C and HP-42S best for calculations involving complex numbers -- accuracy, completeness, and rigor. However, they don't have the root function. Still, the function is not strictly continuous for arguments producing negative (cos x), as not all numbers are rational. -- KS ▼ Stefan K. Junior Member Posts: 13 Threads: 2 Joined: Nov 2005 12-04-2007, 03:51 AM Quote: Still, the function is not strictly continuous for arguments producing negative (cos x), as not all numbers are rational. Yes, I think you can't get more discontinuous. In every (however small) interval, you have infinitely (but still countable) many jumps, and in between are uncountable many points with no (real) function value at all. Stefan Egan Ford Posting Freak Posts: 1,619 Threads: 147 Joined: May 2006 12-12-2007, 04:50 PM Chuck, What exactly did you tell Mathematica to get that plot? I have been unable to get Gnuplot, Sage, or the 50g to get the same results. All produce a plot of just the continuous real parts. If I change the function to (cos(x)^(x*35))^(1/35) and use a loop from -10 to 10 step 1/35 as you suggest I get the same plot as above but only for y > 0. The principal root of cos(even/35)^even)^1/35 is real, but the principal root of cos(odd/35)^odd)^1/35 is complex. This explains my plot, but not yours. To add to my confusion the 50g returns a real root for even or odd, yet does not produce the same plot. I find it interesting that the 50g returns -.19081 (a real) for (cos(71/35)^71)^(1/35), yet a complex for (-8)^(1/3). The principal root for cos(71/35)^71)^(1/35) should be 0.1901+ 0.0171i. I understand why the 83+ was able to plot it, it only returns real roots. Edited: 12 Dec 2007, 4:52 p.m. Nenad (Croatia) Member Posts: 172 Threads: 21 Joined: Sep 2005 12-01-2007, 04:17 AM As far as I remember: (COS x)^x=EXP(x LN COS x) In a more general case: a^x=EXP(x LN a) usually showed to be a useful transformation. ▼ Karl Schneider Posting Freak Posts: 1,792 Threads: 62 Joined: Jan 2005 12-01-2007, 01:48 PM Quote: (COS x)^x=EXP(x LN COS x) Indeed, that's the first step in finding the derivative. Then, the "chain rule" and derivative of a product function. -- KS

 Possibly Related Threads... Thread Author Replies Views Last Post HP-35s Cos[x] and Tan[x] bugs resolved? Thomas Windisch 2 1,136 10-31-2013, 01:12 PM Last Post: Dieter HP 15C LE COS key troy 6 1,358 09-18-2011, 12:05 PM Last Post: From Hong Kong where is 35s cos bug Andrew Nikitin 3 992 10-06-2008, 01:41 AM Last Post: Karl Schneider alternative cos(x) and tan(x) [HP-33S] Gerson W. Barbosa 7 1,632 07-27-2007, 02:22 PM Last Post: Gerson W. Barbosa asin(acos(atan(tan(cos(sin(7)))))) Valentin Albillo 6 1,406 02-14-2005, 07:04 AM Last Post: Ralph Is it possible to Plot a SIN or COS Graph in a 19Bii? Marc 0 513 12-03-2003, 07:13 PM Last Post: Marc

Forum Jump: 