Post Reply 
[CAS] Integrals
09-27-2017, 04:14 PM
Post: #1
[CAS] Integrals
Non-converging integrals: Even exponents are undef, odd ones infinite?

int(1/x,x,-1,1); ==> undef
int(1/x^2,x,-1,1); ==> ∞
int(1/x^3,x,-1,1); ==> undef
.
.
.
int(1/x^even(n),x,-1,1); ==> ∞
int(1/x^odd(n),x,-1,1); ==> undef

-Dale-
Find all posts by this user
Quote this message in a reply
09-27-2017, 05:10 PM
Post: #2
RE: [CAS] Integrals
This is correct.
Find all posts by this user
Quote this message in a reply
09-27-2017, 05:11 PM
Post: #3
RE: [CAS] Integrals
Maybe as ∞+∞ usually is ∞ and ∞-∞ can be anything you want.
Arno
Find all posts by this user
Quote this message in a reply
09-27-2017, 05:59 PM
Post: #4
RE: [CAS] Integrals
(09-27-2017 05:10 PM)parisse Wrote:  This is correct.

http://www.wolframalpha.com/input/?i=int...1+1%2Fx,dx
http://www.wolframalpha.com/input/?i=int...%2Fx%5E2dx

Wolfram claims those integrals don't converge. Parisse says that the integrals (results), are correct. Does that mean that for CAS purposes undef == infinity? If they are different, please explain. As the integral bounds includes 0, non-convergence occurs.

(I have a calc 1 student, in the family, and wasn't sure how to explain this).

-Dale-
Find all posts by this user
Quote this message in a reply
09-27-2017, 06:51 PM
Post: #5
RE: [CAS] Integrals
Well, not an easy task, it is based on the fact that the real numbers are defined without +∞ and -∞, so to solve integrals like that you have to calculate both the integrals on the left side and on the right side with not zero but an "a" as lower bound, for example \[\int_a^1 \! \frac{1}{x^{n}} \, \mathrm{d}x\]Then you have to perform
\[\lim_{a \rightarrow 0}-\frac{1}{n-1}+\frac{1}{(n-1)\cdot a^{n-1}}\]
this always leads to +∞, the left hand side makes, dependent on n, + or - infinity.
As both limits are no real numbers the integrals do not converge. Then there is the point with compactification of the real numbers, both plus and minus infinity are taken in, this often leads to conclusions like in my post above.
Arno
Find all posts by this user
Quote this message in a reply
09-27-2017, 07:24 PM
Post: #6
RE: [CAS] Integrals
Thanks for the explanation, but it doesn't quite fit the problem. In this case, and as Wolfram correctly interprets, it's treated as a proper integral. The integrals in my examples, do not converge; there are no solutions, per the original formula.

Over the boundary indicated in the integrals, -1 to +1, zero is not excluded. Since the denominator vanishes, at x=0, they do not converge. They asymptote at the singularity prevents it. I don't think infinity is a correct solution.

I haven't tried this in other CAS software, but now my curiosity is tweaked, so I think I will. My granddaughter is in a calc 1 class and encountered this particular kind of problem. The correct answer, according to her teacher, was that it does not have a solution. In the next class, calc 2, they cover improper integrals, and at that time I'm pretty sure they will cover similar problems using the technique you describe.

-Dale-
Find all posts by this user
Quote this message in a reply
09-27-2017, 07:43 PM
Post: #7
RE: [CAS] Integrals
So your granddaughter is dealing with Riemann-integrals, one point is that the integrand has to be continous which here clearly is not the case, she is done with the task when she writes that down. The rest is to be discussed later.
Arno
Find all posts by this user
Quote this message in a reply
09-28-2017, 03:50 AM (This post was last modified: 09-28-2017 03:50 AM by AlexFekken.)
Post: #8
RE: [CAS] Integrals
(09-27-2017 07:43 PM)Arno K Wrote:  So your granddaughter is dealing with Riemann-integrals, one point is that the integrand has to be continous which here clearly is not the case, she is done with the task when she writes that down. The rest is to be discussed later.
Arno
From what I remember Riemann integrals are more generally defined for piece-wise continuous functions.

So continuity is not the issue, a singularity with an infinite areas is. It might be worth trying to integrate |x|^(-1/2) and x^(-1/3) on the same interval...
Find all posts by this user
Quote this message in a reply
09-28-2017, 05:14 AM (This post was last modified: 09-28-2017 05:16 AM by parisse.)
Post: #9
RE: [CAS] Integrals
Make a graph and compute the area under the curve. For 1/x^2 (or even powers), all the area is positive, you get an infinite area. For 1/x, the discussion is more open, you can argue it is 0 or leave it undefined.
And don't forget that a CAS just does computation, you must use your brain to interpret the answer.
Find all posts by this user
Quote this message in a reply
09-28-2017, 11:09 AM
Post: #10
RE: [CAS] Integrals
(09-28-2017 05:14 AM)parisse Wrote:  Make a graph and compute the area under the curve. For 1/x^2 (or even powers), all the area is positive, you get an infinite area. For 1/x, the discussion is more open, you can argue it is 0 or leave it undefined.
And don't forget that a CAS just does computation, you must use your brain to interpret the answer.

For an area under the curve to exist, 1/x^n must exist. This is where the confusion between my brain and CAS are conflicting. Specifically, there is a continuous interval, [-1,1], which includes x=0. So analytical approaches, such as graphing, are merely warning that the area is not continuous at 0. The result should be undef, for all 1/x^n, where x=0.

Wolfram agrees. Try plotting Y=int(1/X^2,X,-1,1) in the Advanced Graphing App. It, too, seems to agree with Wolfram. CAS reports an infinite area, which is less accurate than an undefined area.

If painting a curvy chateau is the task, and part of the area doesn't exist, (perhaps due to a partition), CAS is saying an infinite amount of paint must be purchased to complete the task, and you'll need the rest of your life, (and any reincarnations), to accomplish it. (If that area is modeled by an even power of 1/x^n, at x=0). So much for technology!
Find all posts by this user
Quote this message in a reply
09-28-2017, 11:15 AM
Post: #11
RE: [CAS] Integrals
(09-28-2017 03:50 AM)AlexFekken Wrote:  
(09-27-2017 07:43 PM)Arno K Wrote:  So your granddaughter is dealing with Riemann-integrals, one point is that the integrand has to be continous which here clearly is not the case, she is done with the task when she writes that down. The rest is to be discussed later.
Arno
From what I remember Riemann integrals are more generally defined for piece-wise continuous functions.

So continuity is not the issue, a singularity with an infinite areas is. It might be worth trying to integrate |x|^(-1/2) and x^(-1/3) on the same interval...

For sure. However, the problem is not about "how" to solve the core issue. It is about the CAS integrate command, and how it handles f(x)=1/x^n, where x=0, over a continuous interval that includes 0, with even or odd powers.
Find all posts by this user
Quote this message in a reply
09-28-2017, 07:27 PM
Post: #12
RE: [CAS] Integrals
DrD, I'm not sure you fully understand generallized integrals. For example int(ln(abs(x)),x,-1,1)=-2 despite the fact that ln(abs(x)) is not defined at x=0 inside the interval -1..1.
Every mathematician will agree that int(1/x^2,x,0,1) is a divergent integral, but a divergent integral to +infinity. The same is also true for int(1/x^2,x,-1,0). Therefore the sum is +infinity, it is not undefined.
int(1/x,x,0,1) is also +infinity, but int(1/x,x,-1,0) is -infinity therefore the sum is not well-defined, returning undef is perfectly acceptable. It might also be observed that by symmetry, the integrals compensate, and therefore returning 0 is also acceptable.
Conclusion: Wolfram alpha is not God, it's not because the Prime and Wolfram alpha disagree that the Prime is necessarily wrong.
Find all posts by this user
Quote this message in a reply
09-28-2017, 09:24 PM
Post: #13
RE: [CAS] Integrals
(09-28-2017 07:27 PM)parisse Wrote:  Conclusion: Wolfram alpha is not God, it's not because the Prime and Wolfram alpha disagree that the Prime is necessarily wrong.
Parisse,
If you can agree that division by zero is undefined, then Lord only knows, any defined function of division by zero is quite a concept! I understand your explanation, and other CAS products such as MapleCloud, agree with you. Some don't.

That's all I had in mind on this topic. Thank you for taking time to share your expertise. I hope, somehow, this will be useful for others, as well.
Find all posts by this user
Quote this message in a reply
09-28-2017, 11:33 PM
Post: #14
RE: [CAS] Integrals
(09-28-2017 11:15 AM)DrD Wrote:  For sure. However, the problem is not about "how" to solve the core issue. It is about the CAS integrate command, and how it handles f(x)=1/x^n, where x=0, over a continuous interval that includes 0, with even or odd powers.
I think you already partly answered that question in your original post. I simply suggested looking at those results in a wider context to try to understand what the tools does in those cases as well. At least I think the purpose of your question (which wasn't really a question, in spite of the question mark :-)) was to try to understand what the tool does with these types of problems.

As with most of these types of discussions, the expectation of many seems to be that we should be able to use a tool as a substitute for (rather than an aid to) our brain. And that we should not even have to state our questions unambiguously; the tool should just know what we want and infer any context (from what?). As in this case we typically discuss ambiguous situations in which there is a context or expectation that did not go into the question that we asked of the tool. And then we expect the tool to come up with the "right" answer neverthless.

In this particular case (integration), do we only want to see real (or complex) answers or do we accept extended real or complex numbers (and if so, using a one or two point compactification)? Do we want a Riemann integration (proper or improper) or a Lebesgue integration? I might want my integral of sin(x)/x from 0 to (plus) infinity to be undefined (or divergent) because I only care about "proper" Lebesgue integrals. Someone else might want to get the textbook result for the improper Riemann integral or "undefined" because it is not a proper Riemann integral. Similarly, I might want my 0^0 to be undefined because my exponents could be any (positive) real number, while someone else, working with power series perhaps, wants x^n to be 1 when n=0 and regardless of x.

Rather than expecting silver bullets, we should take responsibility for knowing the quirks and limitations (as opposed to outright bugs; the distinction may be difficult to make) of our tools, especially if we decide to blindly rely on them. If we can't agree on what outcomes we "should" get, then it is unreasonable to expect a tool to make the "right" decision for us.
Find all posts by this user
Quote this message in a reply
09-29-2017, 01:17 PM (This post was last modified: 09-29-2017 01:20 PM by DrD.)
Post: #15
RE: [CAS] Integrals
Apologies for the brevity of the original question. The simplicity of the question mark was to indicate curiosity, and stimulate discussion. Not so much an interrogative statement. The reason is that differing languages and translations can be confusing at times. My objective was to let the example demonstrate the subject, rather than a verbose discussion.

My opinion, regarding use of brain vs. tool, is to gain advantage, mental or mechanical.

External constraints can be placed on the advantage, for example if an educator needs to have students demonstrate learned skills. Ultimately though, I want to use a tool to obtain the greatest return on its investment. A corollary to the Prime/Brain thing is aircraft or marine navigation equipment. For example, marine AIS provides marine vessel information in detail. When a target object shows up on the nav screen, that information is immediately useful, rather than braining it out. The result provided contains closest point of approach, time thereof, etc., its easily interpreted, without regard to "ambiguous" questioning. (I hope that makes the point).

Regarding the Prime, one of my interests is in capturing deficiencies, and feed them back to the "team" in order make a better product. I enjoy trying to do that. I have a lot of respect for Bernard, his background, and the product overall. He is very close to the CAS, and very protective of it. That means I have to try my best to make a valid case for any change.

The nuances of issues under discussion, plus language translation issues, tend to make me overthink problems, and I sense that Parisse probably finds that frustrating. In the past I have offered concerns that have not been something Parisse wanted to change. I respect that, but accumulating these discussions, over time, doesn't do much to assure Parisse of my underlying good intent! Anyway, that's my only goal.

Quote:
... that we should not even have to state our questions unambiguously; the tool should just know what we want and infer any context (from what?).

In the OP example, the context comes from the actual information provided. Namely the boundaries. No expectations for any further interpretation, such as if the boundaries are to be segregated, or theoretical approaches applied to undefined regions, (the singularity).

That shouldn't be a restriction, however. A future enhancement might provide an 'option' to treat vanishing points in an exceptional manner. However, the command sent to the tool was to integrate over the continuum. It can't, and that should be the answer.

Returning a theoretical answer, is superfluous, when based on the application of the "tool" to just the information provided. Given, "how to cut a tree," a reasonable result might be "use a chainsaw," without regard to anticipating the size of chainsaw or trees, or depending on what one might encounter in forests, etc. If boundaries WERE provided: small chainsaw and huge trees, in large forests, the result "undef" would be useful, more so than infinity.

As far as other peripheral concerns, settings in the CAS setup, should dominate. (Complex, vs, real, etc.).

That's my perspective, anyway. The tool should assist the brain to operate more efficiently. As technology evolves, we are seeing more examples of this process, ever more frequently. I hope I can contribute along the way...

-Dale-
Find all posts by this user
Quote this message in a reply
09-29-2017, 02:33 PM
Post: #16
RE: [CAS] Integrals
(09-29-2017 01:17 PM)DrD Wrote:  However, the command sent to the tool was to integrate over the continuum. It can't, and that should be the answer.

Thanks for your detailed response and my apologies if I sound over the top. I see a lot of these types of discussion being based on a misunderstanding or misrepresentation of the underlying mathematics and so I try to correct and explain, usually from a mathematical (abstract if you like) viewpoint. In that sense the quote above is where I disagree with you and have to say "it depends".

If it is your choice (!) that all expressions involving a singularity or infinity should have an undefined result then I can at least agree that this might provide a consistent framework that could be the basis for a CAS or numerical tool. And presumably it would make life easy (or easier) for people like Parisse.

But as soon as you expect the tool to be able to handle some types of "singular behaviour" without automatically producing an "undefined" result (and most people apparently would expect that, or "infinity" would not even exist as a possible value) then you are opening the door to the sort of discussion that we are having here and you need to motivate when and why a result should be "undefined", "infinite" or something else.
This is why I mentioned the integral of |x|^(-1/2), which by your logic (if I understand it correctly) should also be undefined because the function is also unbounded near zero, just like x^(-2). Of course every mathematician would disagree with you on that...

NOTE: I have assumed that by "integrate over the continuum" you mean "integrate an unbounded function", or one that "goes to infinity", and not "integrate over the interval of all real numbers".
Find all posts by this user
Quote this message in a reply
09-29-2017, 05:10 PM
Post: #17
RE: [CAS] Integrals
(09-29-2017 02:33 PM)AlexFekken Wrote:  
(09-29-2017 01:17 PM)DrD Wrote:  However, the command sent to the tool was to integrate over the continuum. It can't, and that should be the answer.

NOTE: I have assumed that by "integrate over the continuum" you mean "integrate an unbounded function", or one that "goes to infinity", and not "integrate over the interval of all real numbers".

No, by continuum, I meant ALL of the specified, bounded, continuous interval [-1, 1], (given in the OP definite integral examples), and real numbers, (not complex), based on [CAS] and [HOME] settings. The continuum is -1 to 1, continuously, including the endpoints, (real x-values, ranging continuously from -1 to 1, and the function values of x are valid everywhere, EXCEPT at the x=0, point within the continuum of x=[-1..1].

An enhancement to provide indication in the title bar that complex numbers are on/off; (likewise, some means to restrict values to integers, reals, or complex numbers, via the assume() command), would be useful. If the title bar included indication for allowable numbers, it would have been obvious in a screenshot.

I appreciate your reasoning, (and Arno's!), and understand Parisse's explanation. The result gives a more advanced response than the underlying problem is requesting. int(1/x^n,x), for any power of x, where n≥0, ought to include some consideration, where x=0, in the result. A warning that analytical approaches are used at critical numbers, would be helpful. Otherwise it should fail, as other similar, (but not all), software does.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)