222 - Topic 05 - Limits Symbolically

157 days ago by Professor222

var('x,y') def f(x,y): if x+y<>0: return sin(3*(x^2+y^2+5*pi))/(x^2+y^2) else: return 3 
       
x0=0 y0=0 # Something was wrong with the f defn above and eventually sage would "forget" the defn. Gee whiz. # f(x,y) = sin(3*(x^2+y^2+5*pi))/(x^2+y^2) f(x,y) = x*y^2/(x^2+y^4) 
       
f(pi,3) 
       
9*pi/(pi^2 + 81)
9*pi/(pi^2 + 81)
var('t') x1=x0+t y1=y0 x2=x0 y2=y0+t x3=x0+t*cos(10*t) y3=y0+t*sin(10*t) x4=x0+t^2 y4=y0-t^5 x5=x0-t y5=y0-t/2 # If the limit exists,it must agree with the limit along any of given curves. L = limit(f(x=x5,y=y5),t=0) L 
       
0
0
       
0
0
G = plot3d(f,(x,-1,1),(y,-1,1)) G += parametric_plot3d([x1,y1,f(x=x1,y=y1)],(t,0.01,1),color='red',thickness=10) G += parametric_plot3d([x2,y2,f(x=x2,y=y2)],(t,0.01,1),color='yellow',thickness=10) G += parametric_plot3d([x3,y3,f(x=x3,y=y3)],(t,0.01,1),color='orange',thickness=10) G += parametric_plot3d([x4,y4,f(x=x4,y=y4)],(t,0.01,1),color='green',thickness=10) G += parametric_plot3d([x5,y5,f(x=x5,y=y5)],(t,0.01,1),color='purple',thickness=10) G += point3d([x0,y0,L],color='white',size=25) G.show() 
       
# The above stuff combined into an interactive cell var('t,x,y') @interact def _(x0=(0),y0=(0),f = (x*y^2/(x^2+y^4)),in3d=checkbox(default=false)): x1=x0+t y1=y0 x2=x0 y2=y0+t x3=x0+t*cos(10*t) y3=y0+t*sin(10*t) x4=x0+t^2 y4=y0-t^5 x5=x0-t y5=y0-t/2 L = limit(f(x=x5,y=y5),t=0) G = plot3d(f,(x,-1,1),(y,-1,1)) G += parametric_plot3d([x1,y1,f(x=x1,y=y1)],(t,0.01,1),color='red',thickness=10) G += parametric_plot3d([x2,y2,f(x=x2,y=y2)],(t,0.01,1),color='yellow',thickness=10) G += parametric_plot3d([x3,y3,f(x=x3,y=y3)],(t,0.01,1),color='orange',thickness=10) G += parametric_plot3d([x4,y4,f(x=x4,y=y4)],(t,0.01,1),color='green',thickness=10) G += parametric_plot3d([x5,y5,f(x=x5,y=y5)],(t,0.01,1),color='purple',thickness=10) G += point3d([x0,y0,L],color='white',size=25) if in3d: G.show(stereo="redcyan") else: G.show() 
       
x0 
y0 
in3d 

Click to the left again to hide and once more to show the dynamic interactive window

limit(limit(f,x=0),y=0) 
       
(x, y) |--> -3
(x, y) |--> -3
f(x,y) = sin(x*y)/(x+y)^2 
       
var('z') limit(f(x=z,y=z),z=0) 
       
1/4
1/4
limit(limit(f,y=0),x=0) 
       
(x, y) |--> 0
(x, y) |--> 0
limit(f(x=t,y=2*t),t=0) 
       
2/9
2/9