Definite integration yields a strange answer. (Solved) - Printable Version +- HP Forums ( https://www.hpmuseum.org/forum)+-- Forum: HP Calculators (and very old HP Computers) ( /forum-3.html)+--- Forum: HP Prime ( /forum-5.html)+--- Thread: Definite integration yields a strange answer. (Solved) ( /thread-5124.html) |

Definite integration yields a strange answer. (Solved) - pwarmuth - 11-13-2015 08:44 PM
I've run into an interesting output when I attempt to do perform a definite integration. [attachment=2780] This doesn't seem to be correct. This is correct, but is not in a form that is applicable to what I am trying to do. I want the real-valued answer See here: http://www.wolframalpha.com/input/?i=int%28x^%281%2F3%29-x^%282%2F3%29%2Cx%2C-1%2C0%29&a=^_Real I also tried this in the home screen, thinking that this was just an unexpected behavio of the CAS. [attachment=2781] No dice. Here are my CAS settings for anyone curious. [attachment=2782] When I perform this on other calculators, it returns the correct (real-valued) answer of -27/20. Does anyone know why the Prime is returning this? Edit---- Here is my version information: [attachment=2783] It is also noteworthy that this is after resetting the calculator (with the button in the back) to ensure that the settings were defaulted and all variables cleared. RE: Definite integration yields a strange answer. - Tim Wessman - 11-13-2015 09:16 PM
What makes you believe the answer is incorrect? http://www.wolframalpha.com/input/?i=int%28x^%281%2F3%29-x^%282%2F3%29%2Cx%2C-1%2C0%29 To clarify here, the principal root is what is being used in the calculation. RE: Definite integration yields a strange answer. - pwarmuth - 11-13-2015 09:42 PM
http://www.wolframalpha.com/input/?i=int%28x^%281%2F3%29-x^%282%2F3%29%2Cx%2C-1%2C0%29&a=^_Real I'm trying to get it to return the real-valued answer. I've edited the original post to better clarify my question. Complex numbers are not involved in the calculations for the problem sets that I am working. The option to use complex numbers is likewise disabled. Why then, is the calculator returning a complex answer involving i? I've also tried this with the option for 'Principal' disabled, the results are identical. (Though, I don't know if that is related to what I am seeing here or not) RE: Definite integration yields a strange answer. - Han - 11-13-2015 10:13 PM
Perhaps you should use 3 NTHROOT x instead of x^(1/3) (and similarly 3 NTHROOT x^2 instead of x^(2/3) RE: Definite integration yields a strange answer. - Helge Gabert - 11-13-2015 10:24 PM
And this topic (principal root vs. real roots) has been discussed numerous times. Here is one of the previous posts with good explanations: http://www.hpmuseum.org/forum/thread-3570.html?highlight=principal+root RE: Definite integration yields a strange answer. - pwarmuth - 11-13-2015 10:28 PM
[attachment=2784] That works, but why? They inputs are mathematically identical and the options have not changed. Yes, I read the post. I do not agree. I could understand that approach if there was not already an explicit option for complex results. It's this kind of stuff that bothers me about this CAS. You already give me the option of whether or not I want complex answers in the options menu! Then the calculator goes and ignores what I told it to do because it's been programmed to give different answers depending on how you ask the question. It is not immediately obvious that the calculator should behave this way, and for a student this is frustrating. Also, I must point out that my TI nspire CX CAS does not behave this way. I know it's blasphemy to bring that up in this forum, but that calculator is the competition and it's less confusing to use its CAS. With graphing it's way behind, but how often do I really need to graph something? Not everyone using this calculator is coming from a background with the classic HP calculators. Not everyone knows the NTHROOT command. I shouldn't have to dig into forums and write a PHD thesis on giac/Xcas to get it to output what I want when there is an explicit option for it in the CAS settings. I've also been taught to rewrite these problems with fractional exponents before performing anti-differentiation, and I gave it to the calculator in that format. That output was surprising and unexpected, and just cost me an hour of my time trying to find an answer. I find that to be rather typical with this CAS, and it shouldn't be. I have to reach for my TI far too often, and I'd rather not. RE: Definite integration yields a strange answer. - pwarmuth - 11-14-2015 03:34 AM
I do appreciate the help from the users in this forum. I don't want to come off sounding unappreciative of your time. I am a bit frustrated with this calculator at times, but I do believe it is superior. Perhaps later on in my math studies the distinction pointed out to me today will make more sense and will be identified as convention. For the moment though it's just another layer of confusion on an already difficult subject. RE: Definite integration yields a strange answer. (Sufficiently Explained) - parisse - 11-14-2015 07:19 AM
I think you are in fact confused by the math curriculum of your country. In France, we also teach antiderivatives of fractional powers as a special case of x^alpha, but we give examples of definite integration with positive arguments and that makes really sense because x^alpha=exp(alpha*ln(x)) is not defined if x<0. I can't see any added value in understanding antiderivatives or powers to take negative argument, to the contrary it will just confuse students like you and calculators CAS designed for the US math curriculum must take odd conventions to handle fractional powers. RE: Definite integration yields a strange answer. (Sufficiently Explained) - pwarmuth - 11-14-2015 01:29 PM
I was thinking about you last night, Parisse. I am glad to see that you are OK. RE: Definite integration yields a strange answer. (Sufficiently Explained) - Vtile - 11-14-2015 01:39 PM
(11-13-2015 10:28 PM)pwarmuth Wrote: It's this kind of stuff that bothers me about this CAS.*Applauses* PS. There should be somesort of "tooltip" behaviour build in on these, to note user that "Hey you are making this at this way, but did you know that there also the another route." Man forgets (or is still on route to undertand), in my case I read the subject of antiderivatives etc. at systematical way some 8 years ago and hardly used them after, man forgets if not use activitely. It would be nice that calculator does not. PPS. I speak about the implementation for HP calcs, not giac/Xcas as general, the audience is different or atleast much broader with handheld calculator than scientific CAS library on PC / mainframe. RE: Definite integration yields a strange answer. (Sufficiently Explained) - pwarmuth - 11-14-2015 03:41 PM
This is how my math book teaches it during the Calculus 1 sequence. [attachment=2786] [attachment=2787] Later, at the beginning of Calculus 2 content, it expands on this for exponents of -1, but I have not seen a distinction for fractional exponents. [attachment=2788] RE: Definite integration yields a strange answer. (Sufficiently Explained - Updated) - parisse - 11-14-2015 05:17 PM
The rule you show probably assumes integer exponents (because of the choice of the letter n) and it is perfectly adapted to highschool math. The rule is also valid for real exponents, provided that x is >0, because otherwise x^alpha is not defined since x^alpha:=exp(alpha*ln(x)). Defining fractional powers x^(p/q) for x>0 can be done without introducing logarithms by solving a^q=x^p, and this can be extended to x<0 if q is odd, but the general convention used by CAS is not that one (probably because it is not defined for q even), it is take the principal determination of the complex logarithm ln(-x)+i*pi and apply exp(p/q*(ln(-x)+i*pi)). Numerically speaking x^(p/q) is also computed by applying the rule exp(p/q*ln(x)). The Prime provides two functions: x^(p/q) is the normal complex definition and NTHROOT (also named surd in other CAS like giac or maple) remains in the real domain (if q is odd) and I believe it's the best choice one can do. What I do not understand is that it seems (from what I read in the forums) that there are exercices in the US textbooks with definite integrations with fractional powers of x with x negative, using the x^(p/q) notation instead of the n-throot notation. I don't understand that because it does not make you understand fractional powers or integration better than you would if x was positive. To the contrary, it will confuse people. RE: Definite integration yields a strange answer. (Sufficiently Explained - Updated) - pwarmuth - 11-14-2015 05:53 PM
I am not an expert on US pedagogy, but this how it has been taught to me. At least at the current point that I am at in Calculus. It also seems that this is perfectly acceptable an approach for x^n, n != -1. Granted that the domain of x must be restricted to non negative numbers when the roots are even, but (-1)^(-2/3) is within the real number domain. For these fractional exponents, all you have to do is add one to the exponent, and then divide by the new value in the exponent. This will work for real numbers with the exception of n = -1 because (x^0)/0 is undefined. I realize it's a limited definition and is not a general rule as it does not take into account non-real numbers, but it works for now and is what I'm being taught. See this example of a problem that I worked out. This is u substitution, I just didn't write out the u and du portions of it because it's trivial to do this in my head and it's not for a professor. I've been taught to rewrite the problem before moving forward with the integration. [attachment=2794] [attachment=2793] Edit: This is the answer key for this problem, so I am correct in doing it this way as far as the author is concerned. The book is "Calculus", by Ron Larson & Bruce Edwards, Ed. 10e. [attachment=2795] RE: Definite integration yields a strange answer. (Sufficiently Explained - Updated) - pwarmuth - 11-14-2015 06:28 PM
I'm getting away from the point, this is not meant to be a discussion about pedagogy. The point is that there are two ways to solve the problem. One involves the complex plane and the other does not. The CAS has an option as to whether or not I want the calculator to return a complex answer, and then ignores that setting altogether when I use fractional exponents. This however does not apply to other areas of the CAS. For instance when factoring (x^2 + 4) . The complete answer is to include the complex parts (x + 2i)(x - 2i), but the calculator will do what I asked it to do and return it unfactored if I have the option to include i deselected. Why is that behavior not consistent throughout the CAS? RE: Definite integration yields a strange answer. (Sufficiently Explained - Updated) - parisse - 11-14-2015 08:13 PM
You misunderstand the meaning of the complex mode setting (note that this is named i on the Prime CAS settings, complex on the Prime is the complex variable mode setting). If you keep complex mode unchecked, it does not mean you will stay in the real domain. For example, sqrt(-1) will return i if complex is unchecked. Checking complex just says to the CAS that factor and associated functions should behave like if coefficients were complex even if they are all reals. On the hp49, it was mandatory to check complex if you wanted to leave the real domain. It was however not efficient because you had to switch mode too often. That's the main reason I designed giac that way. For fractional powers, you must understand that x^(1/3) *is* a complex number if x<0, whatever the complex mode setting is (on the hp49, the system would ask you to switch to complex mode or error, on the Prime it will return a complex number). If you want the real 3rd root, just use NTHROOT or surd. RE: Definite integration yields a strange answer. (Sufficiently Explained - Updated) - pwarmuth - 11-14-2015 08:57 PM
I see. Thank you for taking the time to explain this for me. RE: Definite integration yields a strange answer. (Sufficiently Explained - Updated) - Vtile - 11-14-2015 08:58 PM
solved... RE: Definite integration yields a strange answer. (Solved) - Aries - 01-30-2019 08:21 PM
(11-14-2015 08:13 PM)parisse Wrote: You misunderstand the meaning of the complex mode setting (note that this is named i on the Prime CAS settings, complex on the Prime is the complex variable mode setting). If you keep complex mode unchecked, it does not mean you will stay in the real domain. For example, sqrt(-1) will return i if complex is unchecked. Checking complex just says to the CAS that factor and associated functions should behave like if coefficients were complex even if they are all reals. Why x^(1/3) is a complex number if x<0 ? q is odd … RE: Definite integration yields a strange answer. (Solved) - Joe Horn - 01-31-2019 12:51 AM
(01-30-2019 08:21 PM)Aries Wrote:(11-14-2015 08:13 PM)parisse Wrote: ... For fractional powers, you must understand that x^(1/3) *is* a complex number if x<0, whatever the complex mode setting is (on the hp49, the system would ask you to switch to complex mode or error, on the Prime it will return a complex number). If you want the real 3rd root, just use NTHROOT or surd. Simple answer: Graph all three cube roots, and you'll see why. More complete answer: Because (1) every non-zero number has three distinct cube roots, and (2) calculators which allow complex results return the "principal root" which is the one with the least ARG (that is, the smallest angle from the real axis). The ARG of the real cube root of a negative number is 180°, but the ARG of one of the complex cube roots is 60°, which makes it the principal root. RE: Definite integration yields a strange answer. (Solved) - Aries - 01-31-2019 01:54 PM
(01-31-2019 12:51 AM)Joe Horn Wrote:(01-30-2019 08:21 PM)Aries Wrote: Why x^(1/3) is a complex number if x<0 ? Yes … I got it now … thanks son … just applied De Moivre and trigonometric form (polar form) of z … but y'know … Id have liked complex and real into separate "domains" … like in the Nspire CAS … just saying … @pwarmuth is right being puzzled … in my view … Best, Aries |