An integration problem

246 views
Skip to first unread message

T Tran

unread,
Feb 11, 2010, 11:40:39 AM2/11/10
to tinspire
I try to integrate this:
1/(x^3*sqrt(9-x^2))
and evaluate the result (indefinite integral) where x = 2.

The Nspire CAS gave "no real answer"
Mathematica online gave -0.11524062169815109
Maxima gave -0.08205989078652
Casio Classpad gave -0.02102587475

O_o

any idea?

Gert

unread,
Feb 11, 2010, 4:26:16 PM2/11/10
to tinspire
Hi,

What do you mean exactly with "x=2"?

Lower bound 2, upper bound infinite ? Then it is clear, that there is
a problem.

Or do you mean "indefinite" integral. Then the CAS gives:
(2*x^2*ln(√(9-x^2)-3)-x^2*ln(x^2)-6*√(9-x^2))/(108*x^2),
which sounds very nice to me ;-)

Gert

Joe

unread,
Feb 11, 2010, 5:58:53 PM2/11/10
to tinspire
Gert, The TI cas doesn't return an expression for the indefinite
integral that is equivalent to the one returned by Mathematica. They
are similiar but not the same. I don't have the capability to check
out the indefinite integral returned by the classpad or maxima.
Perhaps someone else can do that.

Steve Arnold

unread,
Feb 11, 2010, 6:14:42 PM2/11/10
to tinspire
Hi guys

It is very common for different CAS systems to return non-identical but equivalent forms for complicated algebraic results.

I checked numerically - integrating from 1 to 2 (the function is undefined at 0 so I just picked a couple of values) and the result returned by TI-Nspire (0.140899...) is identical to the (first) result returned by maxima using 3 different methods (Maxima returned a list of 4 values, including 0 and 21 and another that was very very close to zero). Not sure what these represent, but for our purposes, the numerical values are consistent which means that the algebraic forms, although they appear different, are indeed equivalent.

Steve



--
To post to this group, send email to tins...@googlegroups.com
To unsubscribe send email to tinspire+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
http://lafacroft.com/archive/nspire.php



--
With best wishes,
Steve
_________________
Dr Stephen Arnold
Educational Technology Consultant
Compass Learning Technologies

T3 Fellow, Teachers Teaching with Technology Australia

Office: +61-2-4232-2080
Mobile: +61-4-0175-3834
Web: http://compasstech.com.au
_________________

Nelson Sousa

unread,
Feb 11, 2010, 6:30:53 PM2/11/10
to tins...@googlegroups.com
nevertheless, the result returned by Nspire CAS is correct. And so is
the one returned by Mathematica (I checked).

As for the original question: by default complex numbers are
deactivated; go to the document settings and set complex numbers to
polar or rectangular. If your answer is complex then you must have
complex numbers activated, otherwise you get an error.

With complex numbers activated and integrating from 2 to +infinity
(was this what you were trying to do?) I get a complex numeric answer:
0.048879 - 0.029089*i. By the way, Mathematica also returns a complex
number, although a different (probably convergence issues on one of
the algorithms). Not sure which one's right.

Nelson

Joe

unread,
Feb 11, 2010, 7:28:53 PM2/11/10
to tinspire
Yep, having given it some more thought. The definite integrals don't
have to be the same, i.e, there doesn't have to be a unique solution
as long as differentiating each cas answer returns the original
function. However, for the definite integral, the answer should be the
same but that involves evaluating at two limits so evaluating for one
value proves nothing.

> >http://lafacroft.com/archive/nspire.php- Hide quoted text -
>
> - Show quoted text -

Joe

unread,
Feb 11, 2010, 9:26:09 PM2/11/10
to tinspire
OOP's I typed definite integrals in the first line but meant
indefinite integrals. Sorry, it's been a long day.

> > >http://lafacroft.com/archive/nspire.php-Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -

T Tran

unread,
Feb 11, 2010, 10:15:43 PM2/11/10
to tinspire
Hi guys,
It wasn't about the integrating from 1 to 2.

It is to solve the indefinite integral and AFTER the calculator return
you the ANTI-Derivative form of it.
Then you substitute x = 2.
Sorry for the confusion.

Here is what you type into the Ti-Nspire CAS

Int(1/(x^3*sqrt(9-x^2)) ,x)
Ans | x = 2

T Tran

unread,
Feb 11, 2010, 10:24:52 PM2/11/10
to tinspire
These answers which supposed to be equivalent are inconsistent when
substitute a test number.
In my case, I used x = 2.

Joe

unread,
Feb 11, 2010, 11:12:33 PM2/11/10
to tinspire
They are "equivalent integrals", which means that if you differentiate
them you will get the same result. That is the test to determine if
the result of an integration is correct. Differentiate the answer and
see if you get the original expression back. With your test number
test, you are infering that there is only one "unique" correct answer
for the integration and that simply is not true. What is true however
is that the equivalent integrals will produce the same answer when
used to solve a definite integral, that is, one with an upper and
lower limit. I hope that helps.

> > Casio Classpad gave -0.02102587475- Hide quoted text -

Message has been deleted
Message has been deleted

Joe

unread,
Feb 12, 2010, 12:01:55 AM2/12/10
to tinspire
Yes, and this is more than a different representation. This is a
matter of completely different solutions, all of which are correct.
Your error is in thinking that there can only be one correct solution
to the integration.

On Feb 11, 8:39 pm, T Tran <themostwan...@gmail.com> wrote:
> I am well aware of the fact that the results from different CAS can be
> in different representation.
> In this case, not only the representation is different but also the
> "out put" are different.
> In other words, if you graph the result, they are not the same graph.
>
> On Feb 11, 11:29 pm, T Tran <themostwan...@gmail.com> wrote:
>
>
>
> > Dear Joe,
>
> > I think that if f(x) is equivalent to g(x) is only true <=> f(a) =
> > g(a);

> > > > - Show quoted text -- Hide quoted text -

T Tran

unread,
Feb 12, 2010, 12:37:41 AM2/12/10
to tinspire
Nope, you got me wrong.
I've never said there should only be one correct solution for any
integration problem.
What I have been saying is that the Nspire gave "no real answer" where
x = 2.
In other words, the Nspire seems to suggest that the indefinite
integral is "undefined" at x = 2,
thus, there shouldn't be any tangent line at x = 2 when you take
derivative. Its result contradicts to that of other CAS.

Steve Arnold

unread,
Feb 12, 2010, 12:59:11 AM2/12/10
to tinspire
Sorry but you misunderstand: when the Nspire says "No real answer" it means that the answer is complex. In fact, the message I get is:
_____________
Non-real result

For example, if the software is in the Real
setting, √(-1) is invalid.
To allow complex calculations, change the
"Real or Complex" Mode Setting to
RECTANGULAR or POLAR.
_____________

This is quite helpful: If you go to the settings and change the mode to rectangular then you get a result - a complex one.

In exact form, (4*ln(−(√(5)-3))-4*ln(2)-3*√(5))/216+π/54*

In approximate form, −0.048879159874891+0.058177641733144*

Nothing wrong with this, but a mystery as to why we would be getting different results from different CAS systems.

Maxima gives the symbolic result as shown:

-log((6*sqrt(9-x^2))/abs(x)+18/abs(x))/54-sqrt(9-x^2)/(18*x^2)

This evaluates to a real result:

-(4*log((6*sqrt(5)+18)/2)+3*sqrt(5))/216 which is approximately -.08205989078652046

Certainly interesting...


Steve


--
To post to this group, send email to tins...@googlegroups.com
To unsubscribe send email to tinspire+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
image_tns.jpg
image_maxima.tiff

Joe

unread,
Feb 12, 2010, 1:03:24 AM2/12/10
to tinspire
Actually it probably says "Non-real result" meaning that the answer is
a complex value which is not the same as undefined.

T Tran

unread,
Feb 12, 2010, 1:17:21 AM2/12/10
to tinspire
Thank you(s)

Sorry for classifying non-real result as "undefined" :(
Yes Mr. Arnold, the interesting part is the non-real result VS real
result from the same point x = 2
from different CAS.

Let me make it a little clearer. Let say the original function is
function A and the result anti-derivative is B.

I am thinking about what does it have to do with the tangent line
right at the point x = 2.
Since the Nspire says "no real result", it seems to me that the Nspire
is saying x = 2 of function B is not in the Domain of the
indefinite integral function. Thus, if you take derivative of B (which
is expected to return A) there should be a problem with the tangent
line of B at x = 2.
That's, however, not the case with other CAS.

Joe

unread,
Feb 12, 2010, 1:34:02 AM2/12/10
to tinspire
You said: "In other words, the Nspire seems to suggest that the

indefinite integral is "undefined" at x = 2, thus, there shouldn't be
any tangent line at x = 2 when you take derivative. Its result
contradicts to that of other CAS." Ok, maybe I am catching on to what
you are doing, because you also said in your original post that: "I

try to integrate this: 1/(x^3*sqrt(9-x^2)) and evaluate the result
(indefinite integral) where x = 2." If you want the slope of the
tangent line of the original function 1/(x^3*sqrt(9-x^2)) at x=2, you
don't integrate, you differentiate, and then evaluate the result for x
= 2. Or, if you want the slope of the tangent line for the integral,
you differentiate it, in which case you get the original function 1/
(x^3*sqrt(9-x^2)) and evaluate it at x=2. In either case, you will
get a real result. So perhaps you integrated and evaluated at x=2 to
get the slope of the tangent line when you should have
differenitated.

T Tran

unread,
Feb 12, 2010, 1:40:29 AM2/12/10
to tinspire
Dear Joe,
I was trying to find the slop of the anti-derivative form of the
function which should be itself :)
to compare.
I hope making thing clear a little bit.

Peace.

T Tran

unread,
Feb 12, 2010, 1:52:57 AM2/12/10
to tinspire
I should go and shoot myself

Marc Garneau

unread,
Feb 12, 2010, 2:33:21 AM2/12/10
to tinspire
Given the complexity of the equivalent but very different looking
symbolic forms, it's not surprising that they would vary somewhat when
substituting in x=2.
It sounds like you're mostly concerned about the non-real result. In
the Nspire CAS symbolic form, notice the argument within the ln
function. Yet if we evaluate it by placing the argument within an
absolute value function (which could make sense, given the integral of
1/x is ln(abs(x)) +c), then you get a real result, which is actually
identical to an answer I got using PocketCAS on my iPhone.

I don't like ignoring the "+ C" in integration, as it ignores an
important piece of information. Whether the argument of the ln
function should be one thing, or its opposite, depends. Either way,
if you differentiate it you get back the original function. So, I
would say there's no problem here. Those decimal answers don't really
have much in the way of conceptual meaning.

Marc

Nelson Sousa

unread,
Feb 12, 2010, 6:57:56 AM2/12/10
to tins...@googlegroups.com
There is no real answer to the evaluation of the anti-derivative at
x=2. If you got real answers from Mathematica, Maxima and Classpad...
well, they're wrong! I don't have Mathematica here with me but I don't
think you'd get a wrong answer from it, so you probably made a mistake
asking the question.

Here's the thing: one of the terms of the antiderivative is
ln(sqrt(9-x^2)-3). (Mathematica agrees with this).

If x=2 you have sqrt(5)-3 as the argument of ln, which is a negative
number. ln of a negative number is complex. All the other terms are
real, so if you're getting real answers in other CAS products either
you made an error in your input or they're just plain wrong.

Check that you're asking what you want and not something entirely different.


Nelson

Joe

unread,
Feb 12, 2010, 9:20:51 AM2/12/10
to tinspire
Nelson, If you go to the Mathematica on line (integrator) at:
http://integrals.wolfram.com/index.jsp which I think is what Tran was
speaking of, the log term contains sqrt(9-x^2) plus 3, not minus 3.
If you got sqrt(9-x^2)-3 from the Mathematica program, then
Mathematica does not consistently integrate which is quite interesting
but not necessarily incorrect.

Also, Maple returns -(1/18)*sqrt(9-x^2)/x^2-(1/54)*arctanh(3/sqrt(9-
x^2)) as the answer, which is again another integration answer,
however if you do the definite integral from 1 to 2 for any of these
answers, I think you will find that they return the same answer of
0.140899... as Steve Arnold pointed out. I worked the integration by
hand and got still another answer but it still returns 0.140899... for
the definite integral from 1 to 2.

The fundamental theorem of calculus says nothing about the meaning of
the value of an integral at one point, so the answers from
Mathematica, Maxima and Classpad, Joe, etc., can disagree on that, but
they should agree for the definite integral between two limits and as
long as these indefinite integration answers return the original
function when differentiated, they are correct.

> >http://lafacroft.com/archive/nspire.php- Hide quoted text -

T Tran

unread,
Feb 12, 2010, 10:07:55 AM2/12/10
to tinspire
You can go here http://www.wolframalpha.com/
The site uses Mathematica online which is quite powerful.
You can do pretty much quite a lot with it.

Nelson Sousa

unread,
Feb 12, 2010, 10:15:31 AM2/12/10
to tins...@googlegroups.com
I'll have to check that, I'm almost certain Mathematica 6.0 game me a
different result. Plus I started doing the integral by hand (no time
to do it now) and I doubt log(sqrt(9-x^2)-3) doesn't appear. It would
surprise me very, very much. On top of that, Mathematica 5.0 returned
an expression with arcsin...

We'll have to resort to pen and paper for this one.

Nelson

T Tran

unread,
Feb 12, 2010, 10:46:09 AM2/12/10
to tinspire
It needs trigonometric substitution to solve it by hand.
Let x = 3*sin(theta) => sqrt(9-x^2) = 3cos(theta).

On Feb 12, 10:15 am, Nelson Sousa <nso...@gmail.com> wrote:
> I'll have to check that, I'm almost certain Mathematica 6.0 game me a
> different result. Plus I started doing the integral by hand (no time
> to do it now) and I doubt log(sqrt(9-x^2)-3) doesn't appear. It would
> surprise me very, very much. On top of that, Mathematica 5.0 returned
> an expression with arcsin...
>
> We'll have to resort to pen and paper for this one.
>
> Nelson
>

> On Fri, Feb 12, 2010 at 15:07, T Tran <themostwan...@gmail.com> wrote:
> > You can go herehttp://www.wolframalpha.com/

Nelson Sousa

unread,
Feb 12, 2010, 10:56:13 AM2/12/10
to tins...@googlegroups.com
you don't need trigonometric substitutions. Just use x^2+y^2 = 9 and
you'll be fine.

Nelson

Joe

unread,
Feb 12, 2010, 6:48:15 PM2/12/10
to tinspire
Nelson, I don't think it is a matter of needing trig substitutions, it
is a matter of the trig substitution simplifying the problem. The way
I integrated it was with the substitution x=3sin(t) in which case,
dx=3cos(t)dt and the problem simplifies to the integral of (csc(t)^3)/
27*dt. That is easily integrated by parts and reversing the
substitution finishes the problem. I then choose to differentiate my
answer using Maple to ensure that there were no errors by getting the
original function back from the differentiation. I don't understand
how using x^2+y^2 = 9 is going to help because you will then end up
with x and y in the expression to be integrated. Are you going to do
a double integral?

Nelson Sousa

unread,
Feb 12, 2010, 6:53:57 PM2/12/10
to tins...@googlegroups.com
I've just checked and Mathematica indeed returns a term in
log(sqrt(9-x^2)+3), not -3 as I mentioned earlier. There's also
another difference, the sign of both the log(x) terms are switched.

I computed the derivative of the expression returned by the Nspire (by
hand and with Mathematica to do the trickiest parts because I was
always getting wrong signs) and the one returned by Mathematica (on
the Nspire) and they both gave the expected result.

The differences in the evaluation could be caused by some of the
simplifications performed (on either side) that constrain the domain
of the resulting expression

Other than that, I have no more ideas.

Nelson

Nelson Sousa

unread,
Feb 12, 2010, 6:57:35 PM2/12/10
to tins...@googlegroups.com
no. take x^2+y^2=9. Then, x=sqrt(9-y^2). Compute dx/dy, replace the
variable and you'll see it behaves nicely. In the end you're left with
1/(9-y^2)^2 which can be expanded into elementar fractions by the
unknown coefficients method. Then it's a matter of computing 4
immediate integrals.

Nelson

Joe

unread,
Feb 12, 2010, 11:32:07 PM2/12/10
to tinspire
Aw-Ha, I got it Nelson. I worked the problem the way you suggested
but came out with -1/(9-y^2)^2 , a negative sign difference, however
after integrating the four terms, and substituting sqrt(9-x^2) for y
in order to back out the substitution and get the answer in terms of
x, I then differentiated the answer using the TI cas and after a
little re-arranging got the original function proving that the
integration was correct. The partial fraction expansion is a bit
messy as a trade off against the integration by parts using the trig
substitution but both approaches yielded an answer which when
integrated yielded Tran's original expression, so I am sure that if
used for a definite integral, either form of the integral will produce
the same answer and having beat this issue to death it's time for me
to catch up on other things now. Thanks for explaining your approach
to the integration. That was a fun exercise.

> >> >http://lafacroft.com/archive/nspire.php-Hide quoted text -

Wayne

unread,
Feb 13, 2010, 2:57:17 AM2/13/10
to tinspire

I have uploaded the tns file, CERTAIN INTEGRALS INVOLVING SQUARE
ROOTS.TNS, that attempts to explain how the "textbook" real-valued
antiderivative is related to the complex-valued antiderivative given
by the Nspire CAS. It also shows how to obtain one from the other. I
have found that, in this kind of problem, Nspire CAS will (almost)
always compute a complex-valued antiderivative. In order to find the
desired real-valued antiderivative, the user must understand this last
string of calculations found in equation 2 of the tns file. That will
transform a complex-valued antiderivative into a real-valued
antiderivative. Just to be sure that the Nspire CAS haters do not
argue that this behavior is a new problem introduced by Nspire, the
TI-89 has the same behavior and has had for many years. Moreover, the
behavior is not unique to the Nspire CAS, but is shared by some other
CAS which have been referenced on this thread. It is an extremely
complex problem to decide how to handle such integrals in the general
case and should not necessarily be regarded as a flaw in the CAS.

Nelson Sousa

unread,
Feb 13, 2010, 7:07:12 AM2/13/10
to tins...@googlegroups.com
Excellent job explaining it in such detail! Thanks!

Nelson

Joe

unread,
Feb 13, 2010, 8:39:26 AM2/13/10
to tinspire
I would like to read that Wayne. It sounds very interesting. Where
do I find that file? Do you have a link? I couldn't find it on
TI.education.com. Can I simply download it to my computer and read
it, or is it necessary to download it to a handheld and read it that
way? I don't have a handheld. I use the nspire cas software and on
my netbook computer.

Andy Kemp

unread,
Feb 13, 2010, 9:04:59 AM2/13/10
to tins...@googlegroups.com
Wayne uploaded it to the google group:

You will need to either run it on a handheld or in the software...

Wayne

unread,
Feb 13, 2010, 12:43:04 PM2/13/10
to tinspire
Joe,
As Andy says, the tns file is in the files section of the group. Just
go to the files section, right click on the file, choose "Save Target
As..." and put the file in a convenient folder on your netbook. Then
open the file with the Nspire CAS Teacher Edition Software from TI. A
word of caution though. You mentioned education.ti.com and that is a
great resource for Nspire-related files. But don't expect my file to
be anything professional like the files you find there or even like
the ones Nelson or Sean or John or others provide here. The file that
I uploaded was put together in about an hour or two just to help
explain the nature of the complex-valued antiderivatives that Tran
described in the original post. It was not intended to be
professionally done, just as an spontaneous aid to understanding for
us on the group only.
Wayne

> > case and should not necessarily be regarded as a flaw in the CAS.- Hide quoted text -

Joe

unread,
Feb 13, 2010, 2:53:04 PM2/13/10
to tinspire
Hi Wayne,
I guess I am out of luck. I didn't know that there was any kind of
special teachers edition of the nspire cas computer software so I just
purchased and installed the ordinary product from TI. If it is just a
couple of pages, is it possible that you could post it here for
everyone to read? Or maybe present the main points? I am very
curious.

Andy Kemp

unread,
Feb 13, 2010, 2:55:16 PM2/13/10
to tins...@googlegroups.com
You don't need the Teacher Edition it will open fine on the regular version...  The TE just add in the SmartView Emulator... 

Wayne

unread,
Feb 13, 2010, 4:26:01 PM2/13/10
to tinspire
Yep, like Andy said again. I am so accustomed to using the teacher
edition that I forgot all about the standard version without the
emulator. Apologies.
Wayne

> > Wayne- Hide quoted text -

Reply all
Reply to author
Forward
0 new messages