7

I've been trying to answer the same question answered here: Second derivative "formula derivation"

And I'm stuck in a step that is not addressed both in the answer and in the comments of the question over there. In the original question he uses the fact that

$$f''(x) = \lim_{h\to0} \frac{f'(x+h) - f'(x)}{h}$$ $$f''(x) = \lim_{h\to0} \frac{ \frac{ f(x+2h) - f(x+h)}{h} - \frac{ f(x+h) - f(x)}{h} }{h}$$

Which I basically see as taking the derivatives with the same limit 3 times. Shouldn't it be as follow?

$$f''(x) = \lim_{h\to0} \frac{ \lim_{h_1\to0}\frac{ f(x+h+h_1) - f(x+h)}{h_1} - \lim_{h_2\to0}\frac{ f(x+h_2) - f(x)}{h_2} }{h}$$

How do you justify moving to the equation given in the original answer?

Nescio
  • 2,426

3 Answers3

8

Simple answer: You are right that by definition of derivative the expression you gave for the second derivative is the correct one. However it turns out that the other one is equal, though not obviously.

Proof by L'Hopital

One way to prove it is to use L'Hopital's rule once to get:

$\lim_{h \to 0} \dfrac{f(x+2h)-2f(x+h)+f(x)}{h^2} = \lim_{h \to 0} \dfrac{2f'(x+2h)-2f'(x+h)}{2h}$

because numerator and denominator are zero when $h = 0$ and are differentiable with respect to $h$. What we get is not quite the definition of the second derivative so we have to manipulate:

$\lim_{h \to 0} \dfrac{f'(x+2h)-f'(x+h)}{h} = \lim_{h \to 0} 2\dfrac{f'(x+2h)-f'(x)}{2h} - \lim_{h \to 0} \dfrac{f'(x+h)-f'(x)}{h}$

which is valid because both limits on the right exist. Note that:

$\lim_{h \to 0} 2\dfrac{f'(x+2h)-f'(x)}{2h} = 2 \lim_{h \to 0} \dfrac{f'(x+h)-f'(x)}{h}$

since $h \to 0$ is equivalent to $2h \to 0$ or just going by the definition of limit, and the $2$ factors out of the limit. Finally we get:

$\lim_{h \to 0} \dfrac{f(x+2h)-2f(x+h)+f(x)}{h^2} = \lim_{h \to 0} \dfrac{f'(x+h)-f'(x)}{h} = f''(x)$

by definition of second derivative.

Note

Notice that $f$ must be differentiable in an open interval around $x$ which was critical for L'Hopital's rule to work. But $f'$ need not be differentiable or even continuous in an open interval around $x$. All that is necessary, as used in the proof, is that $f'$ is differentiable at the single point $x$.

user21820
  • 57,693
  • 9
  • 98
  • 256
  • hmm I understand. Is there a similar proof without L'Hopital? As we haven't learned it yet I'm not sure I can use it.. Thanks anyway :) – Nescio May 25 '15 at 16:14
  • 1
    I'm writing another completely different proof, but it's at the same level of using L'Hopital in a sense. I'm afraid that any proof of this expression for the second derivative will have to go through a similar route. – user21820 May 25 '15 at 16:21
  • I have a doubt about the last step: there $f'(x)$ represents the derivative with respect to $h$, so the limit of the difference quotient in Leibniz’s notation would be $$\lim_{h \to 0}\frac{\frac{df}{dh}(x+h) - \frac{df}{dh}(x)}{h}.$$ How is this the same as $\frac{d^2f}{dx^2}(x)$? – Arch Stanton Sep 09 '22 at 15:57
  • Or is it perhaps $$\lim_{h \to 0}\frac{\frac{df}{dh}(x+h) - \frac{df}{dx}(x)}{h} ?$$ (Here the second term in the numerator is derived wrt $x$.) Then one could say $\frac{df}{dh}(x + h) = \frac{df}{dx}(h + x)$ (could they, really?) and so the expression would become one I can recognize as the second derivative of $f(x)$. – Arch Stanton Sep 09 '22 at 16:20
  • @ArchStanton: That last step is trivially the definition of derivative of $f'$. If you want to understand what is going on, you need to learn rigorous real analysis. The expression you wrote in your first comment is technically meaningless, and as far as I know not Leibniz notation. And you're plain wrong in saying that "$f'(x)$ represents the derivative with respect to $h$". Please throw away any book that gave you such an idea, and learn from Spivak's "Calculus" instead. – user21820 Sep 10 '22 at 10:26
  • Thanks for the book suggestion. I'm studying chemistry so I haven't really had a rigorous introduction to anything in math. Mathematics for us is like lasers for carpenters. I hope to fix that but it'll cost me some embarrassment here. Please bear with me. My reasoning is, when you use L'Hopital you derive wrt $h$, and the resulting derivative is different from what you get if you derive wrt $x$, right? Then the limit of the difference quotient involving that derivative looks like taking the deriv. of the deriv., but it's actually not the same derivative being taken twice. Where am i wrong? – Arch Stanton Sep 10 '22 at 17:33
  • @ArchStanton: Oh if you're not a mathematics major, then Spivak might be too heavy for you. To answer your question, you need to realize that every equality written in my post is completely self-contained. It doesn't matter how any previous equality is deduced. In the final step, the equality is simply the definition of $f''(x)$, which you can check from any source. There's frankly nothing else to say for that last step. – user21820 Sep 10 '22 at 19:43
  • Your understanding of L'Hopital is also wrong, but I don't think it's a good idea to attempt to understand it until you have fully understood just the last step. – user21820 Sep 10 '22 at 19:51
  • Well thanks, I understand that comments here are not the place to fill my gaps in math but pointing them out is still valuable to me. – Arch Stanton Sep 10 '22 at 19:55
  • @ArchStanton: Sure, but I hope you understand that I can't possibly explain any bit of L'Hopital if you don't even understand the definition of derivative! So, one step at a time! – user21820 Sep 10 '22 at 20:00
  • Of course :-) Also, I realize now that I was looking at $f$ as to a function of two variables $x$ and $h$, which obviously (now I see it) it isn't. I was seeing partial derivatives wrt to $x$ and $h$ when partial derivatives didn't make sense. Silly even for a chemist – Arch Stanton Sep 11 '22 at 06:10
  • @ArchStanton: Um, whatever the case you should never use Leibniz notation unless you know what you are doing. Even if $f$ is a 2-input function, you cannot write "$\frac{df}{dh}$". I'm starting to think you've no choice but to study Spivak. Ping me in this room if you have any questions when learning from that book. You don't have to start now; start when you've free time in the future. – user21820 Sep 11 '22 at 13:11
6

Another completely different method and arguably more intuitive is to use asymptotic expansions.

Proof by asymptotic expansion

For any differentiable function $f$ such that $f'$ is differentiable at $x$ we have:

$f(x+h) \in f(x) + f'(x) h + \frac{1}{2}f''(x) h^2 + o(h^2)$ as $h \to 0$

This uses Little-O-notation so you may want to look at that if you've not come across it. First let us use it to solve the question:

As $h \to 0$:

$f(x+2h) \in f(x) + f'(x) 2h + \frac{1}{2} f''(x) 4h^2 + o(h^2)$

$f(x+h) \in f(x) + f'(x) h + \frac{1}{2} f''(x) h^2 + o(h^2)$

$f(x+2h)-2f(x+h)+f(x) \in f''(x) h^2 + o(h^2)$

$\dfrac{f(x+2h)-2f(x+h)+f(x)}{h^2} \in f''(x) + o(1)$

Therefore $\dfrac{f(x+2h)-2f(x+h)+f(x)}{h^2} \to f''(x)$ as $h \to 0$.

Proof of the asymptotic expansion $\def\rr{\mathbb{R}}$

Let $g(h) = f(x) + f'(x) h + \frac{1}{2}f''(x) h^2$ for any $h \in \rr$.

Then $g'(h) = f'(x) + f''(x) h$ for any $h \in \rr$.

Also $f'(x+h) \in f'(x) + f''(x) h + o(h)$ as $h \to 0$ [by definition of derivative of $f'$].

Thus $f'(x+h) - g'(h) \in o(h)$ as $h \to 0$.

$f(x+h) - g(h) = ( f'(x+c) - g'(c) ) h$ for some $c$ with $|c|<|h|$ [by the mean value theorem]

$\ \in o(h) h = o(h^2)$ as $h \to 0$.

Notes

The above proof easily extends to higher derivatives, and it is easy to prove any similar expressions for them.

user21820
  • 57,693
  • 9
  • 98
  • 256
5

The equation

$$ f'(x) = \lim_{h \to 0} \dfrac{f(x+h)-f(x)}{h} \tag{1}$$

is clearly correct: that's indeed the very definition of the derivative (hence, the derivative exists iff the limit exists).

Now consider the equation

$$ f''(x) = \lim_{h \to 0} \dfrac{f(x+2h)-2f(x+h) + f(x)}{h^2} \tag{2a}$$

or the "centered" version:

$$ f''(x) = \lim_{h \to 0} \dfrac{f(x+h)-2f(x) + f(x-h)}{h^2} \tag{2b}$$

These are not correct in the same sense that $(1)$ is. They are true (as other answers have shown) only if the second derivative exists. Hence they are not valid definitions of the second derivative. The correct definition corresponds to the multiple limit you wrote in the question body, and we cannot get from that to $(2a)$ or $(2b)$. In concrete: it can happen that the limits on the RHS of $(2a)$ or $(2b)$ exist, but $f''(x)$ does not.

The problem is easy to spot in the case of eq. $(2b)$. If it were true, then for any odd function we'd have $f''(0)=0$ - which of course is not true (take for example $f(x)=\sqrt[3]{x}$ ; or any odd function discontinuous at $x=0$).

An example for eq $(2a)$: take $f(x)=x$ for $x$ irrational, $0$ otherwise. Again, the limit in $(2a)$ gives $0$, but $f''(0)$ does not exist.

leonbloy
  • 63,430