- #1

- 757

- 0

I want to approximate derivative of some discrete data, so I pick a point, then pick 2 other points, one on the right, and one on the left. I fit a parabola, and then differentiate the equation of the parabola with respect to X and evaluate it at the middle point.

So, I have (x

_{1},y

_{1}), (x

_{2},y

_{2}), (x

_{3},y

_{3})

The parabola equation, ax

^{2}+bx+c=y gives a 3x3 matrix to solve:

|x

_{1}

^{2}x

_{1}1| |a|

|x

_{2}

^{2}x

_{2}1| |b| = [y

_{1}, y

_{2}, y

_{3}]

^{T}

|x

_{3}

^{2}x

_{3}1| |c|

Then I find the equation that goes through the three points: ax

^{2}+bx+c=y. I take derivative and evaluate dy/dx at x

_{2}. This gives dy/dx = 2ax

_{2}+b

What??? The constant C is not needed at all. So is there any way to reduce the matrix so that it won't have to solve for c, which will get thrown out anyways? It is computationally cheaper, and it seems like a waste to perform useless calculations.

I suck at math so I couldn't figure out what to do here, I'm sure there's a better method but this little paradox strikes me. Anyone know what's going on?