Monday, August 31, 2009

More about e


Previously I posted about a few of the remarkable properties of e, the base of natural logarithms. I said that ex is the function that is the derivative of itself.

Actually, that's not the whole truth. Every function bx is the derivative of itself, you just have to multiply by a constant. The thing is that the constant is 1 when b = e. As you can see in the code below, we obtain the slope of the curve bx at x as loge b * bx. The constant to multiply by is loge b, which equals 1 when b = e.

For more details, see Chapter 6 in Strang.

color.list=c(
'red','magenta',
'cyan','thistle4',
'salmon')
plot(1:15,xlim=c(0.5,1.8),
ylim=c(0,15),type='n')
L = 2:6
L2 = c(1,1.5)
for (i in 1:length(L)) {
b = L[i]
col=color.list[i]
curve(b**x,lwd=10,
add=T,col=col)
for (j in 1:length(L2)) {
x = L2[j]
dx = 0.35
x0 = x - dx
x1 = x + dx
y = b**x
points(x,y,pch=16,
col='blue',cex=2)
m = log(b)*y # slope is const * y
y0 = y - m*dx
y1 = y + m*dx
lines(c(x0,x1),
c(y0,y1),lwd=3,
col='blue') }
}

No comments: