wxdraw2d(yrange=[-0.1,1.1^2],xrange=[-0.1,1.1],axis_left=false,axis_top=false,axis_bottom=false,
xtics={["a",1]},ytics=false,axis_right=false,filled_func=0,fill_color=aquamarine,xaxis=true,xaxis_type=solid,
xtics_axis=true,ytics_axis=true,yaxis=true,yaxis_type=solid,proportional_axes=xy,explicit(x^2,x,0,1),
filled_func=false,explicit(x^2,x,0,1.1),color=black,parametric(1,t,t,0,1),parametric(t,0,t,-0.1,1.1));

with_slider_draw(
   n,makelist(n,n,2,50),
   yrange=[-0.1,1.1^2],xrange=[-0.1,1.1],axis_left=false,axis_top=false,axis_bottom=false,
   xtics={["a",1]},ytics=false,axis_right=false,fill_color=aquamarine,color=black,xaxis=true,xaxis_type=solid,
   xtics_axis=true,ytics_axis=true,yaxis=true,yaxis_type=solid,proportional_axes=xy,
   makelist(rectangle([i/n,0],[(i+1)/n,(i/n)^2]),i,0,n-1),color=blue,explicit(x^2,x,0,1.1),color=black,
   parametric(1,t,t,0,1),parametric(t,0,t,-0.1,1.1)
);   

with_slider_draw(
   n,makelist(n,n,2,50),
   yrange=[-0.1,1.1^2],xrange=[-0.1,1.1],axis_left=false,axis_top=false,axis_bottom=false,
   xtics={["a",1]},ytics=false,axis_right=false,fill_color=aquamarine,color=black,xaxis=true,xaxis_type=solid,
   xtics_axis=true,ytics_axis=true,yaxis=true,yaxis_type=solid,proportional_axes=xy,
   makelist(rectangle([i/n,0],[(i+1)/n,((i+1)/n)^2]),i,0,n-1),color=blue,explicit(x^2,x,0,1.1),color=black,
   parametric(1,t,t,0,1),parametric(t,0,t,-0.1,1.1)
);

f(x):=0.3+0.075*(x+1)*sin(3*(x+1.5)^2)+0.5*x;

wxdraw2d(yrange=[-0.1,0.9],xrange=[-0.1,1.2],axis_left=false,axis_top=false,axis_bottom=false,
xtics={["a",0.2],["b",1]},ytics=false,axis_right=false,filled_func=0,
fill_color=aquamarine,color=black,xaxis=true,xaxis_type=solid,xtics_axis=true,ytics_axis=true,yaxis=true,
yaxis_type=solid,proportional_axes=xy,color=blue,explicit(f(x),x,0.2,1),filled_func=false,explicit(f(x),x,0.2,1),color=black,parametric(0.2,t,t,0,f(0.2)),
parametric(1,t,t,0,f(1)),parametric(t,0,t,0,1.2));

wxdraw2d(yrange=[-0.1,0.9],xrange=[-0.1,1.2],axis_left=false,axis_top=false,axis_bottom=false,
xtics={["a",0.2],["b",1],["x_{k-1}",0.55],["x_k",0.67]},ytics={["m_k",f(0.55)]},axis_right=false,
fill_color=aquamarine,color=black,rectangle([0.55,0],[0.67,f(0.55)]),
xaxis=true,xaxis_type=solid,xtics_axis=true,ytics_axis=true,yaxis=true,yaxis_type=solid,proportional_axes=xy,
color=blue,explicit(f(x),x,0.2,1),color=black,parametric(0.2,t,t,0,f(0.2)),
parametric(1,t,t,0,f(1)),line_type=dots,parametric(0.67,t,t,f(0.55),f(0.67)),parametric(t,f(0.55),t,0,0.55));

wxdraw2d(yrange=[-0.1,0.9],xrange=[-0.1,1.2],axis_left=false,axis_top=false,axis_bottom=false,
xtics={["a",0.2],["b",1],["x_{k-1}",0.55],["x_k",0.67]},ytics={["M_k",f(0.67)]},axis_right=false,
fill_color=aquamarine,color=black,rectangle([0.55,0],[0.67,f(0.67)]),
xaxis=true,xaxis_type=solid,xtics_axis=true,ytics_axis=true,yaxis=true,yaxis_type=solid,proportional_axes=xy,
color=blue,explicit(f(x),x,0.2,1),color=black,parametric(0.2,t,t,0,f(0.2)),parametric(1,t,t,0,f(1)),line_type=dots,
parametric(t,f(0.67),t,0,0.55));