if i have a function like $f(x) = e^{\sqrt{x+\frac{2}{x}}}$.
why is the result of using the formula below, where $x$ is $2$ and $h$ is $0.1$, greater than the exact derivative of $f(x)$?
if i have a function like $f(x) = e^{\sqrt{x+\frac{2}{x}}}$.
why is the result of using the formula below, where $x$ is $2$ and $h$ is $0.1$, greater than the exact derivative of $f(x)$?
Meanwhile you probably found an answer to your questions on your own. Nonetheless I took the time to take a closer look. I turns out that the result of your four point finite difference approximation formula is just $0.0025$% biger than $f'(2)$. In case this deviation is too much I'd suggest you reach for another approximation.
Notwithstanding this nothingness of $0.0025$% this does not answer the reason of the positive deviation. Maybe you plotted a graph of your function, at $x=2$ it is convex. Even so your four point approximation formula is symetric the higher slope at $x=2.1$ and $x=2.2$ is reflected in the result.
There is an explanation for a simpler numeric derivative approximation showing "funny" results when the function changes from concave to convex and back. It could also help to shed some light on your observation.