Symbolic limit of a function of 2 variables, HP49/50



#2

HI,

Here is a program for HP49/50 whch try to find the lim (X,Y)->(a,b) of a function of two variables.
Just put your function on the stack (variables must be X,Y) , and the { a b } limit you search. You will see in return :

lim:number is the limit found by the program
lim: oo (infinite limit)
lim:? no limit found
lim: f(t) no limit, the function returned is the limit in function of t, the angle of approach.
Must be in RPN and exact mode. Be careful about X Y r t not define as global variables. If you try it, you will see some limitations but in most cases it works fine.

«
{'X' 'Y'} DUP ROT ADD = + « SUBST » STREAM
DUP
'X=0' SUBST
'Y=0' SUBST
IF EVAL DUP '?' SAME THEN
DROP
'X=r*COS(t)' SUBST
'Y=r*SIN(t)' SUBST
SIMPLIFY
IFERR 'r=0+0' lim THEN DROP2 '?' END
ELSE
NIP
END
SIMPLIFY 'Lim' ->TAG
»
'LimXY' STO

For example :

'3*X^2*Y/(X^2+Y^2)' { 0 0 } LimXY. Here you get :
lim:0

'(X^2-Y^2)/(X^2+Y^2)' {0 0}
Lim: '-(2*SIN(t)^2-1) that means no limit (as the limit depands of the
angle to approach the point). You can modifiy this if you prefer with '?'
and no detail

'X*SIN((X+Y)/4)' { 'PI' 'PI' }
Lim:PI

'LOG(X+e^Y)/Sqrt(X^2+Y^2)' { 1 0 }
Lim:LOG(2)

'LN(X+Y)/(X^2+2*X*Y+Y^2-1)' { 1 0 }
Lim:1/2

'(X^2*Y^5)/(X^4+X^2*Y^2+Y^4)' {0 0}
Lim : 0

'8*(X^2*Y^2)/(X^4+Y^4)' {0 0}
Lim: '-((8*SIN(t)^4-8*SIN(t)^2)/(2*SIN(t)^4-2*SIN(t)^2+1))' @ Mean the
limit does not exist

SIN(X+Y)/(X+Y) { 0 0 }
Lim: 1

' (X^2+Y^2-2*X-2*Y)/(X^2+Y^2-2*X+2*Y+2)' { 1 -1 }
Lim: oo (infinty)

' (X^3+X*Y^2)/(X^2+Y^2)' { 0 0 }
Lim : 0

etc.


Edited: 26 Aug 2012, 10:34 a.m.


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP50g: Writing a function that returns a function Chris de Castro 2 2,143 12-10-2013, 06:49 PM
Last Post: Han
  HP: Dump the predefined variables! bluesun08 12 3,898 11-19-2013, 02:18 PM
Last Post: bluesun08
  HP Prime suggestion to avoid Numeric/Symbolic confusion Chris Pem10 4 1,897 11-19-2013, 05:49 AM
Last Post: bluesun08
  HP Prime... NOT meant to replace HP48,49,50 ? Chris Pem10 21 5,790 11-18-2013, 03:30 PM
Last Post: Chris Smith
  HP Prime - local variables retain their initial type BruceH 4 1,919 11-10-2013, 12:42 PM
Last Post: Michael de Estrada
  Shutdown with the Apps key and more than 10 variables in a program. Davi Ribeiro de Oliveira 10 3,932 11-05-2013, 01:26 PM
Last Post: Han
  HP Prime: Number of external Variables Davi Ribeiro de Oliveira 0 1,039 11-01-2013, 08:10 PM
Last Post: Davi Ribeiro de Oliveira
  HP Prime variables Davi Ribeiro de Oliveira 3 1,721 10-31-2013, 02:24 AM
Last Post: cyrille de Brébisson
  HP Prime - deleting variables bluesun08 1 1,260 10-29-2013, 06:36 PM
Last Post: Joe Horn
  HP Prime: CAS Variables - -How to save? Helge Gabert 2 1,879 10-27-2013, 11:26 PM
Last Post: Helge Gabert

Forum Jump: