Approximating the second derivative with Taylor’s Series

The Taylor’s Series tells us:

f(x+h)=\frac{h^0 f(x)}{0!}+\frac{h^1 f'(x)}{1!}+\frac{h^2 f''(x)}{2!}+\frac{h^3 f'''(x)}{3!}+...

and
f(x-h)=\frac{(-h)^0 f(x)}{0!}+\frac{(-h)^1 f'(x)}{1!}+\frac{(-h)^2 f''(x)}{2!}+\frac{(-h)^3 f'''(x)}{3!}+...

adding the two together yields:

f(x+h)+f(x-h) = \frac{h^0 f(x)}{0!}+\frac{(-h)^0 f(x)}{0!}+\frac{h^1 f'(x)}{1!}+\frac{(-h)^1 f'(x)}{1!}

+ \frac{h^2 f''(x)}{2!} + \frac{(-h)^2 f''(x)}{2!} +\frac{h^3 f'''(x)}{3!} +\frac{(-h)^3 f'''(x)}{3!} + ...

Notice how odd terms cancel each other which leaves us with:

f(x+h)+f(x-h) = \frac{h^0 f(x)}{0!}+\frac{(-h)^0 f(x)}{0!} + \frac{h^2 f''(x)}{2!} + \frac{(-h)^2 f''(x)}{2!} + ...

Combining like terms and simplifying yields:

f(x+h)+f(x-h) = 2f(x) + h^2 f''(x) + ...

Now solve for the second derivative:

f''(x)=\frac{f(x+h)+f(x-h)-2f(x)}{h^2}

Truncating the series gives an error of O(h^2) .

Advertisements
This entry was posted in Math and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s