부적합 적분

382 days ago by namy0727

t, x = var('t, x') a = 1; b = 10; dt = 1 @interact def improp_int_type1(tpoint = slider(a,b,dt,default=a)): func = 1/x^2 pretty_print(html('$f(x) = %s$'%latex(func))) assume(t>a) A = integral(func,x,a,t) pretty_print(html('$A(t) = %s$'%latex(A))) area = A(t=tpoint); area=RDF(area) pretty_print(html('$A(%s) = %s$'%(tpoint,area))) p = plot(func,(x,a,b)) if tpoint == a: p+=line([(a,0),(a,func(x=tpoint))], rgbcolor=(1,0,0)) else: p+= plot(func,(x,a,tpoint), fill= True, fillcolor='lightblue') p+= line([(tpoint,0),(tpoint,func(x=tpoint))], rgbcolor=(1,0,0)) p.show(xmin=0,xmax=b,ymin=0,ymax=1) 
       
tpoint 

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

t, x = var('t, x') a = 1; b = 10; dt = 1 @interact def improp_int_type1_div(tpoint = slider(a,b,dt,default=a)): func = 1/x pretty_print(html('$f(x) = %s$'%latex(func))) assume(t>a) A = integral(func,x,a,t) pretty_print(html('$A(t) = %s$'%latex(A))) area = A(t=tpoint); area=RDF(area) pretty_print(html('$A(%s) = %s$'%(tpoint,area))) p = plot(func,(x,a,b)) if tpoint == a: p+=line([(a,0),(a,func(x=tpoint))], rgbcolor=(1,0,0)) else: p+= plot(func,(x,a,tpoint), fill= True, fillcolor='lightblue') p+= line([(tpoint,0),(tpoint,func(x=tpoint))], rgbcolor=(1,0,0)) p.show(xmin=0,xmax=b,ymin=0,ymax=1) 
       

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

t, x = var('t, x') a = 2; b = 5 dt = (b-a)/30; dt = RDF(dt) @interact def improp_int_type2_eg1(tpoint = slider(a,b,dt,default=b)): func = 1/sqrt(x-2) pretty_print(html('$f(x) = %s$'%latex(func))) assume(t<b) assume(t>a) A = integral(func,x,t,b) pretty_print(html('$A(t) = %s$'%latex(A))) area = A(t=tpoint) pretty_print(html('$A(%s) = %s$'%(tpoint,latex(area)))) p = plot(func,(x,a,b)) p+= line([(a,0),(a,func(x=2.1))],color='black') if tpoint == b: p+=line([(b,0),(b,func(x=tpoint))], rgbcolor=(1,0,0)) elif tpoint < b: if tpoint > a: p+= plot(func,(x,tpoint,b), fill= True, fillcolor='lightblue') p+= line([(tpoint,0),(tpoint,func(x=tpoint))], rgbcolor=(1,0,0)) else: p+= plot(func,(x,a,b), fill= True, fillcolor='lightblue') p+= line([(a,0),(a,func(x=2.1))], rgbcolor=(1,0,0)) p.show(xmin=0,xmax=5,ymin=0,ymax=func(x=2.2)) 
       

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

t, x = var('t, x') a = 0; b = 1 dt = (b-a)/20; dt = RDF(dt) @interact def improp_int_type2_eg2(tpoint = slider(a,b,dt,default=b)): func = log(x) pretty_print(html('$f(x) = %s$'%latex(func))) #assume(t<b) #assume(t>a) A = integral(func,x,t,b) pretty_print(html('$A(t) = %s$'%latex(A))) area = A(t=tpoint) pretty_print(html('$A(%s) = %s$'%(tpoint,latex(area)))) p = plot(func,(x,a,1.5)) if tpoint == b: p+= Graphics() elif tpoint == a: p+= plot(func,(x,a,b), fill= True, fillcolor='lightblue') p+= line([(a,0),(a,-5)], rgbcolor=(1,0,0)) else: p+= plot(func,(x,tpoint,b), fill= True, fillcolor='lightblue') p+= line([(tpoint,0),(tpoint,func(x=tpoint))], rgbcolor=(1,0,0)) p.show(xmin=0,xmax=1.5,ymin=-5,ymax=func(x=1.5)) 
       

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