par( mai = c(0.5,0.5,0.1,0.1) )
f <- function(x) 3*x^2
plot(f,-1/2,4.5); abline(h=0,v=0,col="blue")
polygon(c(1.5,4,4),c(f(1.5),f(1.5),f(4)),col="yellow",border="red")
plot(f,-1/2,4.5,add=TRUE)
abline(h=seq(5,60,5),v=seq(-1,5,1/2),lty=3,col="grey")
abline(h=0,v=0,col="blue")
points(c(1.5,4),f(c(1.5,4)),pch=20)
g <- function(x) (f(4)-f(1.5))/(4-1.5)*(x-1.5)+f(1.5)
plot(g,-1,4.5,add=TRUE,col="red")
text(0.8,f(1.5),"(x0, f(x0))")
text(3.5,f(4),"(x, f(x))")
text(2.75,4,"x - x0")
text(4.25,25,"f(x) - f(x0)",srt=90)