Definite integral - "x - not defined" ?

Definite integral - "x - not defined" ? - Messages

#1 Posted: 2/7/2019 10:08:26 AM
Conrad

Conrad

0 likes in 1 posts.

Group: User

Hello,

I have the following problem, trying to solve the definite integral int((3*x^3-x^2+2*x-4)/sqrt(x^2-3*x+2),dx,0,1): I get the error "x - not defined" and, of course, no result.
If I change the limits to [0..401], I get a result (!) with no error message, but if I set the upper limit lower than 401, I get the error again...
What is the reason for that?
Thanks in advance for your replies.

Conrad
#2 Posted: 2/7/2019 11:13:06 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

If I change the limits to [0..401]


The integrand is undefined @ x = 1

IntegrateUndefined.PNG

#3 Posted: 2/7/2019 11:41:17 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

The integrand is undefined @ x = 1


Three verdicts in there:
1. Nothing will integrate that freak above x=1.9999999999999999999999999999
2. Nothing will integrate up to x=0.99999999999999999999999999999999
3. Can only integrate in reasonable range of the integrand.
Interesting Classroom example ... always plot the integrand !!!

IntegrateFreak.sm (7 KiB) downloaded 58 time(s).
#4 Posted: 2/7/2019 12:32:46 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Hello Conrad,

Often, it is possible to improve the Smath native Simpson integrator.
Romberg is profitable in example 2 which looks easy from plotting
the integrand, but finally is not so.

Jean

Integrate Romberg Technical.sm (51 KiB) downloaded 64 time(s).
#5 Posted: 2/8/2019 3:50:36 AM
overlord

overlord

552 likes in 1332 posts.

Group: Moderator

you can use maxima plugin if it is necessary.

Regards

maxima_integrate.png

#6 Posted: 2/8/2019 6:33:47 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Hi. I think that here the point is how to handle avoidable discontinuities in SMath. Because integral and other operators or functions not accept the 'if' statement, you can use 'cases' in the definition of f, as this:

Clipboard1.gif

Even this isn't the case, this other is more general for avoiding numerical issues with avoidable discontinuities:

Clipboard2.gif

Best regards.
Alvaro.
1 users liked this post
sergio 2/8/2019 8:59:00 AM
#7 Posted: 2/8/2019 6:47:42 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

About the other discontinuity, at x=2, I guess that you don't want to work with complexes. It's usual take the absolute vale of logs and roots in real analysis calculus. This other isn't avoidable discont, but can be handled in a similar way.

discont_integral.sm (8 KiB) downloaded 63 time(s).

Clipboard1.gif


Best regards.
Alvaro.
3 users liked this post
Вячеслав Мезенцев 2/8/2019 8:30:00 AM, frapuano 2/8/2019 9:52:00 AM, NDTM Amarasekera 2/8/2019 12:14:00 PM
#8 Posted: 2/8/2019 8:33:05 AM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

maple() also can do that.

File not found. File not found.
Russia ☭ forever, Viacheslav N. Mezentsev
2 users liked this post
frapuano 2/8/2019 9:53:00 AM, NDTM Amarasekera 2/8/2019 12:14:00 PM
#9 Posted: 2/8/2019 1:34:33 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

maple() also can do that.


maple [0..1] = -2.98126694400594
Mathcad 11 [0..1]= -2.98126694400554
Smath = -2.98126668567898 ... acc 10000
This is a case of singular end point
#10 Posted: 2/8/2019 3:16:38 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Wrote

... This other isn't avoidable discont, but can be handled in a similar way.



Well, actually, the integral converges for x=2, as one can see in this wolfram result

Clipboard1.gif

That's means that numerical procedure for computing int in SMath needs some improvements.

Best regards.
Alvaro.
#11 Posted: 2/8/2019 4:13:59 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

That's means that numerical procedure for computing int in SMath needs some improvements.


That's an old long due request.
At least, we have the adaptive from Carlos
Romberg algo style works well, very useful too.

  • New Posts New Posts
  • No New Posts No New Posts