I want to find the second derivative of function $f(x)=-(x-1)^{2}+(x-1)^{3} \sin \left(\frac{1}{(x-1)^{2}}\right)$ at x = 1
according to the definition of limit:
f[x_] := -(x - 1)^2 + (x - 1)^3 Sin[1/(x - 1)^2]
Limit[((f[h + k + x] - f[k + x])/h - (f[h + x] - f[x])/h)/k /.
x -> 1, {h -> 0, k -> 0}]
Limit[((f[h + k + x] - f[k + x])/h - (f[h + x] - f[x])/h)/k, {h -> 0,
k -> 0}]
Limit[((f[h + k + x] - f[k + x])/h - (f[h + x] - f[x])/h)/
k, {h, k} -> {0, 0}]
But the result of the above code is very strange, I want to know what the correct method should be?
f
is perhaps incomplete. It is undefined at1
. And so neither the first nor the second derivative is defined at1
. Perhapsf[1] = 0
? Actually it is better to usePiecewise
, in which case the first limit will give the correct answer. $\endgroup$f
was a necessary foundation. How to findf''[1]
with the limit is also the principal question, which you do not answer. The answer is, the iterated limit works fine and gives the correct result in both cases, whether one "fixes" the definition off
or not. I think the question is the result of a simple mistake that caused the OP to be confused by the error messages. $\endgroup$