Post Reply 
Integral NA in home, CAS
02-28-2016, 10:06 PM
Post: #1
Integral NA in home, CAS
I can't get int (sqrt (1+x^(-2/3)) from -1 to 1 in CAS, and surpringly, home, no matter how I enter the function. In home, I get invalid input. In CAS, I get a complex number result. It's magnitude does not agree with the true answer of 2(2*sqrt(2) - 1) in the case of nSpire, ~3.657 on Classpad 400.

Is this doable on the Prime?
Find all posts by this user
Quote this message in a reply
02-29-2016, 06:07 AM
Post: #2
RE: Integral NA in home, CAS
Hello,

It probably has something to do with the fact that sqrt(1+x^(-2/3)) is not defined from -1 to 0 in R (it is in C)...

Home definitely can not calculate integrals with complex numbers. I do not know about the CAS.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
02-29-2016, 06:37 AM
Post: #3
RE: Integral NA in home, CAS
The only way to do it in home is the way I do on non CAS machines...I calculate from -1 to -1 EE-12 + from 1 EE -12 to 1.

The exact nSpire result is correct as far as I can tell, confirmed by the above, and by decimal Classpad result...
Find all posts by this user
Quote this message in a reply
02-29-2016, 06:39 AM
Post: #4
RE: Integral NA in home, CAS
int (sqrt (1+x^(-2/3)),x,0,1) is 2*sqrt(2)-1, but I don't see why int (sqrt (1+x^(-2/3)),x,-1,0) should be the same. The nspire might be wrong, why should the Prime automatically be wrong if both calc disagree?
Find all posts by this user
Quote this message in a reply
02-29-2016, 12:46 PM
Post: #5
RE: Integral NA in home, CAS
https://www.wolframalpha.com/input/?i=in...)),x,-1,1)

= 2*sqrt(2)-1*i ~= 2.82842712475-i

https://www.wolframalpha.com/input/?i=in...3)),x,0,1)

= 2*sqrt(2)-1 ~= 1.8284
Find all posts by this user
Quote this message in a reply
02-29-2016, 01:23 PM
Post: #6
RE: Integral NA in home, CAS
For the part in -1..0, the correct answer is 1-i, with the complex definition of the fractionnal power. If you add the 0..1 part, you get 2*sqrt(2)-i as stated by compsystem.
If you take the nthroot instead of the complex fractional power on -1..0, then x "power" -2/3 is negative and smaller than -1, adding 1 will return a negative number, taking the square root a pure imaginary, and the integral is
int (sqrt (1-(-x)^(-2/3)),x,-1,0)=i
Therefore the values reported by lrdheat on the nspire and classpad are wrong, either there is a bug on these calcs, or lrdheat made an input error.
Just curious: where does this integral come from? If it's from a textbook, I really wonder what the author wanted to check...
Find all posts by this user
Quote this message in a reply
02-29-2016, 02:09 PM
Post: #7
RE: Integral NA in home, CAS
When I type this integral from -1 to 1 in my calculator, the result is 1,01143+0,31698*i. ¿¿¿???
Find all posts by this user
Quote this message in a reply
02-29-2016, 02:16 PM (This post was last modified: 02-29-2016 02:16 PM by parisse.)
Post: #8
RE: Integral NA in home, CAS
The "exact" answer from the Prime is not correct in the negative x direction, it's just too complicated to track the algebraic branches from fractional powers and sqrt correctly during symbolic integration. The numeric answer can be obtained by splitting in 2 parts
int (sqrt (1+x^(-2/3)),x,-1.0,0)+int (sqrt (1+x^(-2/3)),x,0,1.0)
If I keep it in one integral, I get undef, probably because of the singularity at x=0. This is really a hard integral, that's why I wondered where it comes from.
Find all posts by this user
Quote this message in a reply
02-29-2016, 03:38 PM
Post: #9
RE: Integral NA in home, CAS
(02-29-2016 01:23 PM)parisse Wrote:  and the integral is
int (sqrt (1-(-x)^(-2/3)),x,-1,0)=i
Therefore the values reported by lrdheat on the nspire and classpad are wrong, either there is a bug on these calcs, or lrdheat made an input error.

If you assume real only and no complex range, is it correct? Those seem to silently ignore any complex range and force real by default.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
02-29-2016, 04:25 PM
Post: #10
RE: Integral NA in home, CAS
You can't stay in the real domain, because the argument of the sqrt is negative. For example if x=-0.5, (-x)^(-2/3) is 2^(2/3)>1 hence 1-(-x)^(-2/3) is negative.
Find all posts by this user
Quote this message in a reply
02-29-2016, 04:30 PM (This post was last modified: 02-29-2016 04:31 PM by Han.)
Post: #11
RE: Integral NA in home, CAS
(02-29-2016 01:23 PM)parisse Wrote:  For the part in -1..0, the correct answer is 1-i, with the complex definition of the fractionnal power. If you add the 0..1 part, you get 2*sqrt(2)-i as stated by compsystem.
If you take the nthroot instead of the complex fractional power on -1..0, then x "power" -2/3 is negative and smaller than -1, adding 1 will return a negative number, taking the square root a pure imaginary, and the integral is
int (sqrt (1-(-x)^(-2/3)),x,-1,0)=i
Therefore the values reported by lrdheat on the nspire and classpad are wrong, either there is a bug on these calcs, or lrdheat made an input error.
Just curious: where does this integral come from? If it's from a textbook, I really wonder what the author wanted to check...

Perhaps I am misreading your post, but for \( x \in [-1,0] \), \( x^{-2/3} \) would be positive due to the 2 in the exponent (if not using the complex fractional power). These other calculators are computing the integral as follows:

https://www.wolframalpha.com/input/?i=in...)),x,-1,1)

Their algorithms may possibly be using the even-ness of the integrand since the integral is an improper integral.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
02-29-2016, 05:56 PM (This post was last modified: 02-29-2016 06:02 PM by parisse.)
Post: #12
RE: Integral NA in home, CAS
Indeed, I see your point. Then as you said, it's fairly easy to use the fact that the function is even and get the real value.
For a more general function, it is a good idea to split the interval at the point where the fractional power is singular.
int(sqrt (1+(x^2)^(-1/3)),x,-1,0)+int(sqrt (1+(x^2)^(-1/3)),x,0,1)
Find all posts by this user
Quote this message in a reply
02-29-2016, 06:41 PM
Post: #13
RE: Integral NA in home, CAS
I was thinking same thing as Han ("2" exponent)...indeed, Prime plots function as symmetrical around y axis, but comes up with NAN for area under curve from -1 to 1. The question is whether the integral is undefined or not due to f(X) at X=0.

I believe the problem came from my old calculus book from college circa ~1970. The book is at work...I'll check it later today, but I think it came up with an approximate decimal answer.

I find that the textbooks offer a range of problems for testing CAS's. I'm amazed at their capabilities!
Find all posts by this user
Quote this message in a reply
02-29-2016, 07:00 PM
Post: #14
RE: Integral NA in home, CAS
I'm adding code to automatically split the interval so that
int(sqrt (1+(x^2)^(-1/3)),x,-1,1)
returns the expected answer.
You can check at http://www-fourier.ujf-grenoble.fr/~parisse/xcasen.html. (If you have already visited this page, make sure to empty your browser offline download cache)
Find all posts by this user
Quote this message in a reply
03-01-2016, 12:00 AM
Post: #15
RE: Integral NA in home, CAS
Thanks parisse

The book is College Calculus With Analytic Geometry by Protter/Morrey published by Addison-Wesley in 1970. It indeed was a in the problem set in the chapter dealing with improper integrals. This is an integral that is found to be convergent when split into 2 integrals evaluated from -1 to 0 and from 0 to 1.

The answer was supplied in exact form, 2*((2*sqrt 2)-1).
Find all posts by this user
Quote this message in a reply
Post Reply 




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