HP Forums
Unable to evaluate the following limit - 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: Unable to evaluate the following limit (/thread-15116.html)



Unable to evaluate the following limit - teerasak - 06-02-2020 04:23 AM

I want to find the limit of the piece-wise function as follows:

[Image: cap4.png]

And here are the limit to find out

[Image: cap5.png]

The expected answer is -1 and -1/3 respectively.

In the calculator with latest firmware (2020 01 21), it returns both limits to 0 which is not correct.

In the emulator (as in this picture), it provides error message for the first one, but provide the correct answer for the second one.

I verified this with TI Nspire, it provide the correct answer.

could you please help fix this issue.


RE: Unable to evaluate the following limit - parisse - 06-02-2020 02:03 PM

Can you give the input as a commandline? Pictures are nice but can not be copied/pasted.


RE: Unable to evaluate the following limit - pinkman - 06-02-2020 02:57 PM

Definition of f1:
f1(x):=PIECEWISE(x>1,x^2,(x>0) AND (x<=1),x-1,x<=0,0)

The first limit:
limit(f1(x^2),x,0,-1)

The second limit:
limit((f1(x-1))/(x+2),x,1,1)


RE: Unable to evaluate the following limit - roadrunner - 06-02-2020 04:19 PM

In the simulator if you replace x^2 with x*x you get -1 for the first limit:

limit(f1(x*x),x,0,-1) --> -1

-road


RE: Unable to evaluate the following limit - victorvbc - 06-02-2020 05:35 PM

(06-02-2020 04:19 PM)roadrunner Wrote:  In the simulator if you replace x^2 with x*x you get -1 for the first limit:

limit(f1(x*x),x,0,-1) --> -1

-road

Apparently the expression x^2<=0 simplifies to false (??).

It works with x*x because the calculator doesn't automatically simplify that, so the limit takes the expression x*x<=0.


RE: Unable to evaluate the following limit - parisse - 06-02-2020 06:08 PM

Thanks, this is now fixed in the source code.


RE: Unable to evaluate the following limit - Gene - 06-02-2020 06:59 PM

By the way, I'm not a big PRIME user, but let me say off-topic a thank you to Bernard for all his work on the CAS of multiple HP machines.


RE: Unable to evaluate the following limit - pinkman - 06-02-2020 10:33 PM

(06-02-2020 05:35 PM)victorvbc Wrote:  
(06-02-2020 04:19 PM)roadrunner Wrote:  In the simulator if you replace x^2 with x*x you get -1 for the first limit:

limit(f1(x*x),x,0,-1) --> -1

-road

Apparently the expression x^2<=0 simplifies to false (??).

It works with x*x because the calculator doesn't automatically simplify that, so the limit takes the expression x*x<=0.

I don’t see it: how the 3rd condition could ever be true, even with x*x?


RE: Unable to evaluate the following limit - victorvbc - 06-02-2020 10:50 PM

(06-02-2020 10:33 PM)pinkman Wrote:  I don’t see it: how the 3rd condition could ever be true, even with x*x?

It's true if x=0


RE: Unable to evaluate the following limit - teerasak - 06-03-2020 06:20 PM

Thank you parisse for fixing this. Thank you all for your help. Wink


RE: Unable to evaluate the following limit - pinkman - 06-03-2020 07:59 PM

(06-02-2020 10:50 PM)victorvbc Wrote:  
(06-02-2020 10:33 PM)pinkman Wrote:  I don’t see it: how the 3rd condition could ever be true, even with x*x?

It's true if x=0

Yes I know that, but I don’t understand what you did understand:
Quote:Apparently the expression x^2<=0 simplifies to false (??).

It works with x*x because the calculator doesn't automatically simplify that, so the limit takes the expression x*x<=0.
What simplification could lead the algorithm to understand x*x is more <=0 than x^2?


RE: Unable to evaluate the following limit - victorvbc - 06-03-2020 08:14 PM

It's not about the expression itself, just that the calculator doesn't evaluate x*x<=0 to false, like it does with x^2<=0. Only if you simplify it.

Here's a screenshot to illustrate my point:

[attachment=8546]

So my theory is the limit program doesn't have any problems with handling the inequality x*x<=0, but it can't handle the direct false from x^2<=0. That's why it throws the "Unable to handle when condition is false error".

Edit: The correct simplification, of course, should just be x^2<=0. Because if x is zero (or some imaginary number), the resulting expression is true.


RE: Unable to evaluate the following limit - pinkman - 06-03-2020 09:00 PM

Thanks, I didn’t get it, now I do!