HP Forums

Full Version: Integral NA in home, CAS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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
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...
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?
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...
When I type this integral from -1 to 1 in my calculator, the result is 1,01143+0,31698*i. ¿¿¿???
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.
(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.
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.
(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.
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)
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!
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)
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).
Reference URL's