x0=0.5;xmax=2.0;
f[x_]:=x^2;
point[x_]:={x,f[x]};
slope[x_,h_]:=(f[x+h]-f[x])/h;
g[x_,h_]:=(slope[x,h]*x)+Sqrt[x]-x*slope[x,h];
plotg[h_]:=Plot[g[x,h],{x,-xmax,xmax}];
secant[x_,h_]:=Graphics[Line[{point[x],point[x+h]}],PlotRange->{{-xmax,xmax},{0,1.1xmax^2}},Axes->True,PlotLabel->
Column[{"slope="<>ToString[slope[x,h]],"x0="<>ToString[x0]}]
];
points[x_,h_]:=Graphics[Point[{point[x0],point[x0+h]}]];
plotf=Plot[f[x],{x,-xmax,xmax}];
show[x_,h_]:=Show[{secant[x,h],points[x,h],plotf(*,plotg[h]*)}];
Manipulate[show[x0,h]
,{h,xmax,0.0000001,0.00001}
]

(*{x0,y0}={1,1};*)
(*point:={x0,y0};*)
xmin=-10;xmax=10;ymin=-20;ymax=20;
plotrange={{xmin,xmax},{ymin,ymax}};
Manipulate[
f[x_]:=1/x;
y0:=f[x0];
slope[x_]:=f'[x];
y[x_]:=y0+slope[x0]*(x-x0);
pf:=Plot[f[x],{x,xmin,xmax},PlotRange->plotrange];
(*py=ListPlot[Table[{x,y[x]},{x,xmin,xmax,0.2}]];*)
plotlabel={point,"slope=",slope[x0]};
py:=Plot[y[x],{x,xmin,xmax},PlotRange->plotrange,PlotStyle->Purple,PlotLabel->plotlabel];
point:={x0,y0};
showpoint:=ListPlot[{point},PlotStyle->Red];
Show[{py,pf,showpoint}],
{x0,xmin,xmax,0.051}
]

(*{x0,y0}={1,1};*)
(*point:={x0,y0};*)
xmin=-5;xmax=5;ymin=-5;ymax=20;
plotrange={{xmin,xmax},{ymin,ymax}};
M:=Manipulate[
f[x_]:=x^2;
y0:=f[x0];
slope[x_]:=f'[x];
y[x_]:=y0+slope[x0]*(x-x0);
pf:=Plot[f[x],{x,xmin,xmax},PlotRange->plotrange];
(*py=ListPlot[Table[{x,y[x]},{x,xmin,xmax,0.2}]];*)
plotlabel:={point,"slope=",slope[x0]};
py:=Plot[y[x],{x,xmin,xmax},PlotRange->plotrange,PlotStyle->Purple,PlotLabel->plotlabel];
point:={x0,y0};
showpoint:=ListPlot[{point},PlotStyle->Red];

Show[{py,pf,showpoint}],
{x0,xmin,xmax,1}
];
Print[M]