Skip to main content
25-Diamond I
October 11, 2024
Question

Bug report, symbolic engine in Prime 10, 9 returns wrong numeric result

  • October 11, 2024
  • 3 replies
  • 9211 views

The bug is present in Prime 10 and Prime 9 (can't test with P8 and P7).

Its not present in Prime 6 using the new engine!

Prime 10 & 9:

Werner_E_0-1728685636756.png

 

Prime 6 with new engine (FriCAS/Axiom)

Werner_E_1-1728685714139.png

 

I hate to say it, but the very same example also fails (in a different way) in Mathcad 15 with muPad as engine, too 😞

Werner_E_2-1728685833282.png

Prime 6 sheet attached

 

3 replies

23-Emerald IV
October 12, 2024

Mathcad 11/Maple

LucMeekes_0-1728721164511.png

LucMeekes_0-1728721491504.png

 

Success!
Luc

Werner_E25-Diamond IAuthor
25-Diamond I
October 12, 2024

I am sorry to see that Maple in MC11 is coming up with an incorrect result as well when the absolute value is used.

 

Reason seems to be that, while the symbolic evaluation of the indefinite integral is correct in all versions, all versions (including Prime 6, which so far is the only version which returns a correct result for the definite integral) return a function which is only piecewise continuous.

Werner_E_0-1728735447664.png

 

Therefore this integral function must not be used to calculated the definite integral the 'usual', simple way (which is was all versions except Prime 6 seem to do),

Werner_E_2-1728732791773.png

but instead has to consider the jumps at the discontinuities.

To get the correct result we could use

Werner_E_1-1729017922534.png

EDIT: SORRY!! The above was awfully wrong! The zero of f(x) is NOT at pi/9 but rather arcsin(1/3) of course!
F(x) is not defined at this position (division by zero, actually a form of 0/0) so we have to use the limes

Werner_E_0-1729017133519.png

 

 

Somehow Prime 6 is the only version where the symbolic version is able to return a correct result, even though its ugly looking

Werner_E_4-1728733248749.png

And of course once we know where the problem seems to be we an also split the integral accordingly o get the correct symbolic result

Werner_E_1-1728735812995.png

 

We get the same results in Prime if we rewrite the function using the square root of the square.
Reason seems to be that an internal simplification ends up at the absolute value again

Werner_E_5-1728733426183.png

 

23-Emerald V
October 12, 2024

Out of idle curiosity, why did you choose that particular integral to evaluate?  Have you a worksheet with multiple calculus equations that you test?

 

I tried it on Wolfram Mathematica and that gave the correct result.

 

Stiuart 

 

I've shuffled things around on my small workspace and I've freed up just room to use my Apple Magic Mouse with my Dell laptop.  Works well, if not perfectly, and makes life so much easier than using the trackpad.  Annoyingly, the tiny mouse I bought specifically for the Dell won't connect ... 

Werner_E25-Diamond IAuthor
25-Diamond I
October 12, 2024

@StuartBruff wrote:

Out of idle curiosity, why did you choose that particular integral to evaluate?  Have you a worksheet with multiple calculus equations that you test?

 

I tried it on Wolfram Mathematica and that gave the correct result.

I was just about trying to generate an example showing that numeric integration often is way off the exact result because of inaccuracies adding adding up and then wanted to show the effect of TOL setting. As an exact reference I would use a symbolic evaluation - at least thats what I thought 😉

However, the result of this integral was too far away from the numerical one and I didn't really believe that the definite integral from 0 to pi/3 could be negative for this function 😉

 

Not surprised that Wolfram can do it

Werner_E_0-1728751380567.png

I just still can't get my head around the misnomers that Wolfram uses

sin^-1 instead of arcsin and sec^-1(3) instead of arccos(1/3).

But Wolfram deliberately does not adhere to existing standards because he wants to set his own standards 😞

23-Emerald V
October 12, 2024

OK, thanks. 

 

The sin-1 and sec-1/3  were the standard when I learned mathematics in the UK, and young Mr Wolfram learned maths in the UK.

 

At the time, I thought the Russian(*) use of arcsin and arcsec was archaic, although I preferred that notation.

 

Stuart

 

(*) At university, some of the physics papers I was interested in were in Russian.  So I sat down with a dictionary and sort-of-crudely translated the bits that seemed relevant from the formulae.

 

Typical.  We have a nice storm raging outside and I wanted to measure the wind speed.  I have one of those handheld anemometers, and I saw it a week or so ago.  But can I find it, even though I ransacked the house (I've got Viking ancestry, apparently)?? No, of course not.  Good day to take a longboat for a sail.

19-Tanzanite
October 14, 2024

SMath Studio with Maxima engine used outputs these result of this integral:

Cornel_0-1728901335343.png

 



Werner_E25-Diamond IAuthor
25-Diamond I
October 14, 2024

Thanks for trying.

Its disappointing that SMath returns a wrong result, too.

19-Tanzanite
October 14, 2024

Both Maple version 6 and Maxima engines are not able to calculate this integral symbollicaly in SMath Studio:

Cornel_0-1728904498258.png