Integration Error?

Hi everyone,

I’ll probably post this as a bug but I just can’t understand how this can happen, so I thought it best to get others’ thoughts here first.

I have a very easy integral calculation which for some reason displays in Note and Error Checking as a rounding error, when in the graph it calculates with perfectly fine precision.

Here’s what’s happening: Integration Error

I can’t really think how Desmos is even getting into trouble here. Any ideas?

If you’re wondering about the inaccuracy of getting -1.5000000000000009 rather than -1.5, well, that’s the reality of computer calculations. One must always be aware that perfect accuracy is never expected since computers have such limitations. So,one way to avoid such is to always check within a tolerance level you expect to see. The solution is to write your check as
correct = numericValue("\abs(${this.numericValue}-${g.number(A_1)})") < 0.0001 and this.submitted
So, not a bug. Just a reality.

No it’s a bug. I’m not sure I explained myself well or perhaps you didn’t look at the graph.

The graph component itself correctly evaluates the integral but the transfer between the graph component and other components such as the Note and Function input do not correctly carry the same value. See the graph itself to verify this.

I’m not interested in epsilon based correctness for the purposes of this activity and as it happens it’s not the issue at hand. Thank you for your thoughts though.

Actually, the graph gives the same answer as the note. It shows “-1.5” because Desmos is not displaying more significant figures. However, if you take your graph’s answer and add 1.5, the calculation issue appears.
image

A simple example of this fundamental issue is illustrated here:
image

Thanks for your investigation, however that does not adequately explain what’s happening.

Try adding any other number except its contrapositive and it will correctly evaluate the integral - the evaluation is precise.

So while interesting, and perhaps revealing, I am not subsequently adding the contrapositive to test for zero-ness(which matters a lot in this context), simply taking the graph’s evaluation and placing it in the note - the values do not agree.

For ill-behaved functions the phenomenon you’re talking about can happen, when attempting to sum to zero, but that’s not what’s going on here.

This function is simply composed of linear segments - in fact I’ve used this exact method for linear piece-wise integrand functions many times without issues, so I’m curious what is really going on here.

edit:
I completely agree that there’s a rounding issue(the reason the post is here at all!) but my main questions are:
a) Why this happens at all for a linear function, as i’ve used this method many times before with no problems until now
b) Why Desmos does not share consistent values between components(if value errors occur, I expect them to occur consistently)

Thanks!

Thanks for your message Werner(we have a little chat going on in our messages).

For everyone else, the issue is this:

Desmos is inconsistent in its linear integral handling and I’m really curious why. Sometimes it does things correctly(in fact I’ve used such things with Transcendentals and it hasn’t had any issues) but seemingly has unpredicatble issues with very very simple integrals.

hmmmm

Here’s another Activity that might help illustrate the more general fact that it’s often perfectly ok evaluating linear integrals.