Ketinit(); Setketcindyjs(["Label=[X]","Color=offwhite"]); Ketcindyjsmain(["_;_;微分係数の定義(1)"],["関数の式と$a$の値を代入して,平均変化率が微分係数に近づく様子を確認する."]); Seteditable(50,["y=","Size=18","Width=100"]); Movetojs(Text50,[-1.5,4.5],18); //only ketjs Seteditable(51,["a=","Size=18","Width=50"]); Movetojs(Text51,[4.5,4.5],18); //only ketjs Setwindow([-1,4],[-1,4]); str0="y=x^2"; //str0=Textedit(50); //only ketjs Deffun("f(x)",["regional(y)",str0,"y"]); tmp0=Strsplit(str0,"="); if(length(tmp0_2)>0, Plotdata("1",tmp0_2,"x",["dr,1.5"]); ); str1="a=1"; //str1=Textedit(51); //only ketjs tmp1=Strsplit(str1,"="); if(length(tmp1_2)>0, aa=parse(tmp1_2); Pointdata("1",[aa,f(aa)],["Size=2"]); Listplot("1",[[aa,0],pt1_1],["do"]); Htickmark([aa,"a"]); ); if((length(tmp0_2)>0)&(length(tmp1_2)>0), Slider("X",[XMIN,-1.5],[XMAX,-1.5]); Pointdata("s1",[aa,-1.5],["Size=2"]); Expr(pts1_1,"n1","a"); xx=X.x; eps=10^(-2); mm=Derivative(gr1,"x="+text(aa)); Expr([4.25,2.5],"ne","f'(a)="+text(mm),["Color=blue"]); if(abs(xx-aa)>eps, Pointdata("2",[xx,f(xx)],["Size=2"]); Listplot("2",[[xx,0],pt2_1],["do"]); Htickmark([xx,"x"]); Lineplot("1",[pt1_1,pt2_1]); Expr([4.25,3.5],"ne","x-a="+text(xx-aa)); Expr([4.25,3],"ne","\dfrac{f(x)-f(a)}{x-a}="+text((f(xx)-f(aa))/(xx-aa))); , Plotdata("2",text(mm)+"*(x-"+text(aa)+")+"+text(f(aa)),"x",["Color=blue"]); Expr([4.25,3.5],"ne","x-a=0"); ); ); Windispg();