Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline conrad  
#1 Posted : 07 February 2019 16:08:26(UTC)
conrad

Rank: Newbie

Groups: Registered
Joined: 07/02/2019(UTC)
Posts: 1
Germany

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

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 07 February 2019 17:13:06(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: conrad Go to Quoted Post
If I change the limits to [0..401]

The integrand is undefined @ x = 1

IntegrateUndefined.PNG

Offline Jean Giraud  
#3 Posted : 07 February 2019 17:41:17(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
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 (8kb) downloaded 40 time(s).
Offline Jean Giraud  
#4 Posted : 07 February 2019 18:32:46(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
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 (52kb) downloaded 44 time(s).
Offline overlord  
#5 Posted : 08 February 2019 09:50:36(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,126
Turkey

Was thanked: 507 time(s) in 338 post(s)
you can use maxima plugin if it is necessary.

Regards

maxima_integrate.png

Offline Razonar  
#6 Posted : 08 February 2019 12:33:47(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
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.
thanks 1 user thanked Razonar for this useful post.
on 08/02/2019(UTC)
Offline Razonar  
#7 Posted : 08 February 2019 12:47:42(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
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 (9kb) downloaded 41 time(s).

Clipboard1.gif


Best regards.
Alvaro.
thanks 3 users thanked Razonar for this useful post.
on 08/02/2019(UTC),  on 08/02/2019(UTC),  on 08/02/2019(UTC)
Offline uni  
#8 Posted : 08 February 2019 14:33:05(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
maple() also can do that.

2019-02-08_16-38-01.png 2019-02-08_16-32-06.png

Edited by user 08 February 2019 14:38:33(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 2 users thanked uni for this useful post.
on 08/02/2019(UTC),  on 08/02/2019(UTC)
Offline Jean Giraud  
#9 Posted : 08 February 2019 19:34:33(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: uni Go to Quoted Post
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
Offline Razonar  
#10 Posted : 08 February 2019 21:16:38(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: Razonar Go to Quoted Post
... 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.
Offline Jean Giraud  
#11 Posted : 08 February 2019 22:13:59(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Razonar Go to Quoted Post
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.

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.