f[x_]=(x-2)(x-1)(x+2)/3

plot1=Plot[f[x],{x,-3,3},PlotRange->3,AspectRatio->1]

plot2[x1_,x2_]:=ListPlot[{{x1,f[x1]},{x2,f[x2]}},PlotRange->{{-3,3},{-3,3}},AspectRatio->1,Joined->False,PlotStyle->Red,PlotMarkers->{Automatic,7}]

plot3[x1_,x2_]:=Plot[{f[x1]+f'[x1]*(x-x1),f[x1]+((f[x1]-f[x2])/(x1-x2))*(x-x1)},{x,-3,3},PlotRange->3,AspectRatio->1,PlotStyle->{Black,Red}]

Manipulate[Show[plot1,plot2[a,b],plot3[a,b]],{a,-2.5,2.5,0.01},{b,-2.505,2.505,0.01}]

slopes[x1_,x2_]:=((f[x1]-f[x2])/(x1-x2))

example[a_]:=Table[{b,slopes[a,b]},{b,{a-1.0,a-.5,a-.25,a-.1,a-.01,a-.001,a-.00001,a+.00001,a+.001,a+.01,a+.1,a+.25,a+.5,a+1.0}}]

MatrixForm[example[-1]]

MatrixForm[example[1]]

g[x_]=Sin[x]

slopes[x1_,x2_]:=((g[x1]-g[x2])/(x1-x2))

MatrixForm[example[0]]