HP Forums

Full Version: CAS problem with solution
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all, I just bought a Prime and tried some things out. So I tried to get a solution in CAS mode for the equation lim X->infinity of (sqrt(X*X+2X+1)-sqrt(X*X)). I think the solution should be 1 but i get -infinity. [attachment=1720]
The plot of the function gives also 1. I tried it in the simulator (rev6975) and the calculator (rev.6975 CASvers. 1.1.2-11) same result.
What do i do wrong?
Thanks for your help Teresa
(03-04-2015 09:14 PM)Teresa Wrote: [ -> ]Hello all, I just bought a Prime and tried some things out. So I tried to get a solution in CAS mode for the equation lim X->infinity of (sqrt(X*X+2X+1)-sqrt(X*X)). I think the solution should be 1 but i get -infinity.
The plot of the function gives also 1. I tried it in the simulator (rev6975) and the calculator (rev.6975 CASvers. 1.1.2-11) same result.
What do i do wrong?
Thanks for your help Teresa

WolframAlpha would agree with your answer:

limit(v(x^2+2*x+1)-vx^2,x,8)

If you give the CAS just a little bit of help, it will give you the correct answer:

[Image: attachment.php?aid=1723]

It seems a bit odd that the CAS doesn't perform the trivial reduction of √x^2 = x. Perhaps it's reducing it to |x|. But even that shouldn't change the solution. Though, depending on the direction of the limit, the answer might be -1 or 1:

[Image: attachment.php?aid=1724]
Interestingly enough, the equation as you have it written does actually work. The ^2 seems to be doing something strange here.

limit(√(x*x+2*x+1)-(√(x*x)),x,∞) ----> 1
limit(√(x^2+2*x+1)-(√(x^2)),x,∞) ----> -∞
(03-04-2015 10:20 PM)Tim Wessman Wrote: [ -> ]Interestingly enough, the equation as you have it written does actually work. The ^2 seems to be doing something strange here.

limit(√(x*x+2*x+1)-(√(x*x)),x,∞) ----> 1
limit(√(x^2+2*x+1)-(√(x^2)),x,∞) ----> -∞

The CAS must be reducing the √(x^2) to just x (rather than |x|). In that case, the limit as x--> -∞ would be -∞:

[Image: attachment.php?aid=1725]

But, regardless of which direction you force the limit it always gives the limit as x goes to -∞:

limit(√(x^2+2*x+1)-(√(x^2)),x,∞,-1) = -∞
limit(√(x^2+2*x+1)-(√(x^2)),x,∞,1) = -∞
What are your cas settings? I get 1.

[attachment=1726]
My CAS settings are standard at least in the simulator (new install and reset). Is there an easy way to print those settings so i could post them?

Thanks for your replies. Learned new things about inputting formulas and that i did not too bad on my own. Even though i would not have spotted the problem when the answer would have been something positive.

Teresa
My CAS settings are:

Angle radians
Number standard 12
Integers Decimal check
Simplify Minimum
Exact check
Use sqrt check
principal check
complex no check
use i check
increasing no check
recursive eval 5
recursive replace 1
recursive function 9
epsilon .00000000001
probability 1E-15
Newton 40

If you want, try it again with these settings. Do you still get -infinity?
(03-04-2015 11:08 PM)Helge Gabert Wrote: [ -> ]What are your cas settings? I get 1.

Excellent. If you check "Use i" in the CAS settings, you get the correct result.

But why would that make a difference?

Bernard?
(03-04-2015 11:42 PM)Mark Hardman Wrote: [ -> ]
(03-04-2015 11:08 PM)Helge Gabert Wrote: [ -> ]What are your cas settings? I get 1.

But why would that make a difference?

To answer my own question.

With "Use i" unchecked:

simplify(√(x^2)) ----> |x|

With "Use i" checked:

simplify(√(x^2)) ----> x
OK, I have found why it does not work: it's sqrt(x^2+2x+1) that is wrongly rewritten as -x-1, there is a missing renormalization of square roots in the series/limit code. You can see it if you do
partfrac(sqrt(x^2+2x+1)-sqrt(x^2))
I'm going to fix that before the end of the week in Xcas.
It was never spotted before because nobody tried limit with the difference of two square roots of perfect squares.
(03-05-2015 08:31 AM)parisse Wrote: [ -> ]I'm going to fix that before the end of the week in Xcas.
always thank you! Smile

Quote:It was never spotted before because nobody tried limit with the difference of two square roots of perfect squares.

so, thanks to Teresa for having found it...

It works with "i" checked in the CAS Settings: what's, precisely, the difference with "i" checked or not, please?

Salvo
What is the difference? Try factoring polynomials with complex solutions with "use i" checked and unchecked, e.g.

factor(x^4 +1), or

solve(x^4+1=0,x)
(03-05-2015 03:20 PM)Helge Gabert Wrote: [ -> ]What is the difference? Try factoring polynomials with complex solutions with "use i" checked and unchecked, e.g.

factor(x^4 +1), or
solve(x^4+1=0,x)

yes, I see (it introduces complex calculation and i in the factorization), but in some cases it can be simplified, like with factor() above (not the solve following)...
With sqrt(X*X+2X+1)-sqrt(X*X) with or without, we have different results.

So, I really don't know what's better Smile
I'd say it is better to have "use i" checked in CAS settings (at least for now, see parisse's note above).
(03-05-2015 05:05 PM)Helge Gabert Wrote: [ -> ]I'd say it is better to have "use i" checked in CAS settings (at least for now, see parisse's note above).

in fact I keep it checked...
Actually, I would recommend keeping i not checked unless you know exactly what you do, and run cfactor or csolve if you need complex factorization/solutions. Some operations behave really differently if complex mode is enabled, for example sqrt(x^2) becomes x instead of abs(x).
(03-05-2015 05:06 PM)salvomic Wrote: [ -> ]in fact I keep it checked...

(03-05-2015 07:31 PM)parisse Wrote: [ -> ]Actually, I would recommend keeping i not checked unless you know exactly what you do...

ok, I've unchecked it Smile
thank you, Parisse, for your precious advise!
Reference URL's