There's an integral it gets the complete wrong answer to.

Oddly, it fails rather completely. It doesn't just report it can't get the right answer but reports a wrong answer. And it doesn't try awhile before it fails; it gives the wrong answer instantly.

It also can give the right answer in approximate mode:

It can also do similar problems correctly in exact mode (when the exponent is smaller):

The TI89 can do it correctly:

[link:http://www.wolframalpha.com/input/?i=integral%28%28sin%28x%29%29^16*cos%282*x%29%2Cx%2C0%2C2*pi%29]Wolfram Alpha link on integral[/link]

Hello Crawl,

I've checked your integral and get same result.

The complex mode of CAS fails too.

First idea: Maybe there is not enough memory for the stack operations.

That may explain why ^8 is possible.

The hp 50g is able to give the right result, when the integrand is

transformed by TEXPAND, TRIG and TLIN (used in this order).

But than it is necessary to get a hint that former result is wrong or the former integrand is not possible to integrate that you have the idea for transforming the integrand.

Double boo-boo!

Sincerely

peacecalc

P.S.:

It functioned till ^10 by ^12 it fails.

IF you use RISCH you get as antideriviate: 0,5*SIN(2*X)*SIN(X)^16, only the second factor was integrated by CAS. Very astonishing!

Quote:

First idea: Maybe there is not enough memory for the stack operations.

That may explain why ^8 is possible.

I don't know. You'd think if it was *trying* to do the integral but running out of memory, it would take a while before returning the wrong answer. Also, I would expect it to end with an error ("Out of Memory") rather than returning zero.

I'm wondering if, as some sort of time saving thing, the system tries to check if trigonometric integrals are even or odd (about their midpoint), and if they're odd, they immediately evaluate to zero. This one, of course, is even. But maybe there's a glitch in how it's checked? This is all just speculation, of course.

Hello Crawl,

I don't think that a checking for symmetry is responsible for this behavior, because ^8 or ^10 works, but not greater for example ^12 or ^16. If you take the step mode and interrupt while it is working, the stack is full with, symbols (even i, that shows me the CAS goes through the complex numbers).

Sincerely

peacecalc

I had a discussion with Bernard Parisse about the topic. Here it is:

Quote:

Hello Bernard,
to the best of my knowledge, the HP 50g CAS is derived from your work (ERABLE). In the MoHPC forum there is a recent thread that points out a bug in the integrator. The CAS is unable to properly integrate SIN(x)^16*COS(2x). Maybe you can enlighten the community what is going wrong in this special case.

Quote:

Hi Marcus,
Indeed there is a bug here. It should return unevaluated, since the trigononometric linearization (that must be called to find the antiderivative) seems to be limited to power 10 (that's why with power 16 it aborts immediatly). Unfortunately I can not fix bugs for the HP50G (I could only for the 49G, but that would require some time since I have not programmed in system RPL since so long (...), moreover the fix would probably not be ported by HP for the 50G). A workaround here is:

SIN(X)^8*SIN(X)^8*COS(2*X) TLIN INTVX 0 '2*pi' PREVAL

Marcus, thank you for contacting Bernard.

Bernard, thank you for the handy workaround which should be applicable to similar type problems (not that I've come across any like this in my life).

Maybe someone at HP could issue a new ROM 2.15+... with this fix :-)

Ronald Williams

Hello Marcus,

thank you for your engagement in that stuff. And thank you to Bernard Parisse for his work and statement, which clears the situation, fast and furious.

As my knowlege in the functionality of the hp 50g raises, raises my respect towards persons, who develops a CAS for an calculator. I hope my "double boo-boo" isn't misunderstood.

Sincerely

peacecalc

Thanks for answering this.

I took another look at this issue and I experimented with higher powers of the sine function up to 64 using Bernard Parisse's workaround. The actual results I get on the HP-50g agree with what I'm getting using computer program XCAS. I did this for three cases. The exact integral gave "-pi*27767032438524099/144115188075855872" in about 5 min. 22 seconds. The approximate integral using "sin(x)^64*cos(2*x)" in std format gave '-.6052984857784' in about 55 seconds and the symbolic anti-derivative (much to long to write out) in about 4 minutes 23 seconds. I set up a small RPL programs to compute the different cases and used the calculator's time function to compute the run times. I find this method easier than the stopwatch approach.

I also looked at the TI-89 emulator, TIEmu v2.00, version 2.05, HW2, all using unrestricted speed. The "sin(x)^64*cos(2*x)" case in exact mode ran for over 24 hours without a solution before I killed it The same case for the symbolic anti-derivative took about 26 seconds but I could not verify that the answer is correct because it does not agree with Wolfram Alpha or XCAS or Xmaxima and I have no desire to try and work it out by hand, assuming I could without mistakes. The approximate mode case gave "-.60529848578 in about 11 seconds. I then decided to try the original case "sin(x)^16*cos(2*x)" in exact mode and found it gave "-715*pi/2048" in about 4 minutes 29 seconds. On the other hand the HP takes about 24 seconds using the workaround and not emulated.

I am always amazed by the HP 49 series of calculators, they provide so many different ways to solve problems. However, the challenge for me is to master the machine and find one that works. One could say the HP 49 series represent the 'Swiss Army Knife' of calculators but then again I may be biased :-)

Ronald Williams

My TI-NSpire CAS CX computes the exact integral of sin(x)^64*cos(2*x) in about 11 seconds. It's the same answer as computed by Wolfram Alpha on my iPad. It's the same exact answer you got on the HP-50g.