# Second Derivative for Non standard Calculus

I am trying to understand how second derivatives work in Non standard calculus (NSA). The definition of the first derivative in NSA is $$st(\frac{ f(x + ε) - f(x) }ε)$$ .

So if we have $$f(x) = x^2$$, then the first derivative is $$st(\frac{ (x + ε)^2 - x^2 }ε)$$ which becomes $$st(2x + ε)$$ which is $$2x$$ as you'd expect.

Lets say we set $$x = 8$$. Here the first derivative is $$st(2 *8 + ε)$$ which is 16 as you'd expect. Now, lets say we make $$x = 8+ε_1$$. Then our first derivative at $$8+ε_1$$ is $$st(2 (8+ε_1) + ε)$$ which is also 16.

But as we move from $$x = 8$$ to $$x = 8+ ε_1$$, then our first derivative does not change, so this implies that our second derivative is 0, when it should be 2 from standard analysis. I'd greatly appreciate anyone telling me where I'm wrong. Thanks

The reason why this doesn't work is simple: This way to derive the derivative only works at standard points. Observe what happens if you e.g. calculate $$f'(\delta)$$ for some infinitesimal $$\delta$$.

(Edited as per comment discussion)

Since you haven't given us your exact process, I'll fill in what I think it is, to show the exact problem.

First we define for any $$x_0\in D\subseteq ℝ$$, where $$x_0$$ is an accumulation point of $$D$$, for a function $$f:D\toℝ$$ its derivative in $$x_0$$ as $$f'(x_0):=st(\frac{^*f(x)-f(x_0)}{x-x_0})$$, if this value is identical for all $$x\approx x_0\land x\neq x_0$$.

This is a text-book definition, but only valid for $$x\inℝ$$. So we can talk about $$f'(x_0)$$, but not about $$f'(x_0+\delta)$$ for $$\delta\approx 0\land \delta\neq 0$$.

What I think you now did was just plug in this definition twice to arrive at $$f''(x_0)$$: $$f''(x_0)=st(\frac{\color{green}{^*f'(x)}-f'(x_0)}{x-x_0})\color{red} = st(\frac{^*\color{blue}{st(\frac{{^*f(x')}-{f(x)}}{x'-x})}-st(\frac{^*f(x'')-f(x_0)}{x''-x_0})}{x-x_0})$$ You here end up with a wrong answer since at the green part, you're trying to use the definition on a non-standard-number. This then causes in the blue part both $$x$$ and $$x'$$ to be non-standard, so the $$st$$ smooths out more than you want it to.

Trying to compute $$^*f'$$ at non-standard points, as far as I know, either uses $$\epsilon$$-$$\delta$$-method over the hyperreals, or computes $$f'$$ as standard function and then uses the transfer method to deduce $$^*f'$$.

There are, however, ways to directly compute $$f^{(n)}(x)$$ for standard $$x$$. In the end you simply need to find the non-standard expression that is equivalent to the stack of limits that you get when iteratively substituting the definition of a derivative in $$f^{(n)}(x)$$.

This however is a bit of a hassle, so in many cases it's skipped over. For example you need to differentiate between iterated limits and simultaneous limits.

• This isn't the issue. OP is essentially computing $f'(x+\epsilon) \approx f'(x) + f''(x)\epsilon$ and then saying $st(f'(x+\epsilon)) = f'(x)$ therefore the second derivative is zero. If they did the same thing at a standard point they would have the same issue, and if they had done the same thing to $f$ instead of $f'$ they would have had the same issue with the first derivative. Commented Sep 3 at 19:58
• @NicholasTodoroff Yes, and the root cause of that is that the method he used to compute the derivative at a point is only defined for standard numbers, but he uses it to compute $f'(x+\epsilon)$ in order to compute $f''(x)$. Commented Sep 3 at 20:06
• I don't disagree with anything in your answer--it's all correct--it just isn't the core of OP's issue. By this same analysis the first derivative of $f$ is zero because $st(f(x + \epsilon)) = f(x)$. Are you going to say that the issue is that $f$ isn't defined at nonstandard points? Commented Sep 3 at 21:27
• @NicholasTodoroff I think our difference in view comes from the OP not showing the steps of the analysis. I've edited in what I think (as per the definition I know) the OP has done, and where the problem arises Commented Sep 3 at 22:53
• I agree OP is not 100% clear, and I appreciate attempt to clarify. Commented Sep 4 at 0:34

$$\newcommand\st{\mathop{\mathbf{st}}}$$If you take the derivative of $$2x$$ you of course get the right thing: $$\st\frac{2(x+\epsilon)-2x}\epsilon = \st(2\epsilon/\epsilon) = 2.$$ The issue is you didn't compute the second derivative. Maybe you're saying "the second derivative is nonzero, but the derivative doesn't change when I add $$\epsilon_1$$." But it does change, you just deleted the change by taking the standard part. In general $$f(x+\epsilon) \approx f(x) + f'(x)\epsilon.$$ The derivative is the coefficient of $$\epsilon$$. At the same time, $$\st f(x+\epsilon) = f(x)$$ because you only moved infinitesimally.

The definition of the first derivative via standard part of the differential ratio will always produce a standard number. Therefore that particular definition only works at standard points and cannot work at a nonstandard point. For example, for the function $$x^2$$ the derivative is $$2x$$, which is nonstandard if $$x$$ is infinitesimal. But in fact one can compute the second derivative via standard part. Indeed, if $$f(x)$$ is twice differentiable at a standard point $$c$$, then $$f''(c)$$ can be found as the standard part of $$\frac{f(c+h)+f(c-h)-2f(c)}{h^2}$$ where $$h$$ is infinitesimal. This produces the second derivative at all standard points. By the transfer principle, the resulting function will be naturally defined at all points.

The second derivative is the derivative of the derivative. $$\DeclareMathOperator{st}{st}$$ \begin{align*} f''(x) &= (f'(x))' \\ &= \st\left( \left. \frac{f'(x+u) - f'(x)}{u} \right|_{u=\varepsilon}\right) \\ &= \st \left( \left. \frac{\st \left( \left. \frac{f(x+u+v) - f(x+u)}{v} \right|_{v = \varepsilon} \right) - \st \left( \left. \frac{f(x+v) - f(x)}{v} \right|_{v = \varepsilon}\right)}{u} \right|_{u = \varepsilon}\right) \text{.} \end{align*}

When you say "move from $$x=8$$ to $$x=8+\varepsilon_1$$, then our first derivative does not change", this is because you've lost track of the three infinitesimal shifts we need, the one we need for $$f'(x+\varepsilon) - f'(x)$$, the one inside $$f'$$ evaluated at $$x+\varepsilon$$, and the one inside $$f'$$ evaluated at $$x$$.

A similar thing happens in normal calculus. "$$f''(3)$$" means to find the second derivative function, then evaluate it. When you say "let $$x = 8 + \varepsilon_1$$", you're evaluating $$f'$$ at $$8 + \varepsilon_1$$. What you are not doing is measuring the second derivative from the rate of change between $$(x,f(x))$$ and $$(x+\varepsilon, f(x+\varepsilon))$$ and the rate of change through $$(x+\varepsilon,f(x+\varepsilon))$$ and $$(x+2\varepsilon,f(x+2\varepsilon))$$.

For your example, $$f(x) = x^2$$, the second derivative is \begin{align*} f''(x) &= \st \left( \left. \frac{\st \left( \left. \frac{(x+u+v)^2 - (x+u)^2}{v} \right|_{v = \varepsilon} \right) - \st \left( \left. \frac{(x+v)^2 - (x)^2}{v} \right|_{v = \varepsilon}\right)}{u} \right|_{u = \varepsilon}\right) \\ &= \st \left( \left. \frac{\st \left( \left. \frac{2xv + 2uv + v^2}{v} \right|_{v = \varepsilon} \right) - \st \left( \left. \frac{2xv+v^2}{v} \right|_{v = \varepsilon}\right)}{u} \right|_{u = \varepsilon}\right) \\ &= \st \left( \left. \frac{\st \left(2x + \overbrace{2u}^{\text{here's your \varepsilon_1 and it's not just u = \varepsilon}} + \varepsilon \right) - \st \left(2x + \varepsilon \right)}{u} \right|_{u = \varepsilon}\right) \\ &= \st \left( \left. \frac{2x + 2u - 2x}{u} \right|_{u = \varepsilon}\right) \\ &= \st \left(\frac{2\varepsilon}{\varepsilon} \right) \\ &= 2 \text{.} \end{align*}

Admittedly, at the place we have "$$2x+2u+\varepsilon$$", we have $$f'(x+u)+\varepsilon$$ and we are going to specialize $$u$$ to $$\varepsilon$$. But we shouldn't be surprised that in this step, we are looking at $$f'(x+\varepsilon) - f'(x)$$, since that's what we'd want/expect to see in the numerator of the difference quotient for the second derivative.

• I didn't downvote, but I am not sure what you mean by your answer. Your formula always gives the value 0 with the traditional interpretation of what "st" means. Commented Sep 4 at 7:39
• "Standard part with respect to $x$" is nonsense in "typical" nonstandard analysis. If you're working in a system with multiple levels of nonstandardness you need to make that explicit, and even if you do I think it's clear that OP is a beginner and so such an answer would be unhelpful without lots and lots of additional explanation. Commented Sep 4 at 17:08
• @MikhailKatz : ordering of "limits" seemed obvious to me, but here it is spelled out. Commented Sep 4 at 21:00
• @NicholasTodoroff : Unclear what you mean. Ordering of "limits" by the method specified was almost immediate after introducing the $\mathrm{st}$ operator when I learned this. Equivalent expression in place now. Commented Sep 4 at 21:01
• If anything it makes less sense. The standard part is a function $\mathrm{st}:\mathrm{Fin}({}^*\mathbb R)\to\mathbb R$ where $$\mathrm{Fin}({}^*\mathbb R) = \{x\in{}^*\mathbb R\;:\;\exists y\in\mathbb R.\:|x|\leq y\}.$$ That's it. You cannot "choose a variable to neglect", nor are there limits involved (though of course this definition of determinant is equivalent to one using limits). Commented Sep 4 at 21:17