1

For a numerical approximation we use the Euler-Forward method, we have as definition $$ f'(x)=\frac{f(x+\Delta x)-f(x)}{\Delta x} $$

Now we have that $f$ is the product of two other functions namely $g$ and $h$. If we apply the product rule first and then use Euler-Forward we get $$ \begin{eqnarray*} (g h)'(x)&=&g'(x)h(x)+g(x)h'(x)\\ &=&\frac{g(x+\Delta x)-g(x)}{\Delta x}h(x)+g(x)\frac{h(x+\Delta x)-h(x)}{\Delta x}\\ &=&\frac{g(x+\Delta x)-g(x)}{\Delta x}h(x+\Delta x)+g(x)\frac{h(x+\Delta x)-h(x)}{\Delta x}\\ &...&+\frac{g(x+\Delta x)-g(x)}{\Delta x}(h(x)-h(x+\Delta x))\\ &=&\frac{g(x+\Delta x)h(x+\Delta x)-g(x)h(x)}{\Delta x}+\frac{g(x+\Delta x)-g(x)}{\Delta x}(h(x)-h(x+\Delta x))\qquad(1) \end{eqnarray*} $$ But when we use the Euler-Forward method immediately we get the first term in $(1)$. So the question is: Why do I have an extra term? I don't see why should become zero. Is it because we are numerically estimating? Then a follow up question, if I didn't make any mistakes, what would we the better method? To use first the product rule and then Euler-Forward or simply use Euler-Forward.

Kaladin
  • 1,485

1 Answers1

1

The real problem here is the use of the "=" sign. The computation you perform to compute $f'(x)$ provides an estimate of $f'(x)$. As $\Delta x \to 0$, the estimate gets better and better. The only real thing you can hope for is that with two different estimates, the difference between them will be of order less than $\Delta x$, so that as $\Delta x$ approaaches $0$, the difference will disappear.

In your example, the right hand term is a product of two things, each of order $\Delta x$, so the product is of order $\Delta x^2$. So both (1) the left hand term, and (2) the sum of the two terms, can serve as estimates of $(gh)'(x)$.

To answer your follow-up, I would need for you to characterize "better." Without that, I can't really answer.

John Hughes
  • 93,729