Hacker News new | ask | show | jobs
by dist-epoch 63 days ago
how does this work for these two different paths which arrive at the same endpoint:

+5 +10 +0 -25 = -15

+5 +12 -2 -25 = -15

They have different graphs if you consider the values above sampling points, this is what parent is asking.

1 comments

the derivative becomes a telescoping sum. it doesn't matter how many points you insert or what the values are because x-x=0

let x_i be in (a,b) with any i drawn from [0,N] and x_0=a and x_N=b

then

int_a^b d/dx F = (F(x_1) - F(x_0))+ (F(x_i+1) - F(x_i))+ (F(x_n) - F(x_n-1)) = F(x_N) - F(x_0)

the derivative produces a ratio of differences and the integral is a weighted sum of those same differences

every middle term is added and subtracted. and only the endpoints remain with opposite sign