Message Boards Message Boards

CHALLENGE -- Defining an ORIGINAL second derivative function?

Posted 10 years ago

I began with this definition of the derivative

Limit Definition of Derivative,

which resulted in: Limit[ #, h -> 0] & /@ { (f[x + h, y] - f[x, y])/ h.

But, I want to calculate the derivative at a point with the definition

Derivative at a Point.

One aim is to increase the accuracy of the calculation by using a set of set of $x$ $i$ (a numerical grid), where the spacing (the distance from one grid point to the next) is $?x$. For example, $?x$ = 0.001, a grid of 10,000 points ( $i$ = 1, . . . , 10000) would span a spatial range of 10 units in $x$.

I'm thinking one of these forms would be ideal for $x$ $i$ ...

xi = i?x
xi = (i ? im) ?x
xi = i?x ? xm,
but I'm not sure which is best.

Ultimately, I want to take a function $f$ of two variables, for example

f[x_, n_] := - Sum [Sin[j x] /j, {j, 1, n}],

at the grid points $x$ $i$, and run through the grid, applying the derivative at a point equation (involving two neighbors for each derivative point). Then, after having the first derivative on the entire grid, calculate the second derivative on the grid, involving two first-derivative neighbors. Finally, I want to see the beautiful results on a plot.

I'm sure there will be a do loop, couple arrays, and ListPlot function involved. I'm just not sure how to do all this, as I've just started with Mathematica.

We have any good solutions?

3 Replies

You do know that Mathematica can compute derivatives:

f'[x]=D[f[x],x] and f''[x]=D[f[x],{x,2}]

POSTED BY: S M Blinder
Posted 10 years ago

UPDATE: I do not want to use the Derivative or D functions. –


UPDATE: I do not want to use the Derivative or D functions. –

You must not, you can use Cauchy's integral to differentiate, see Complex variable methods in Numerical Differentiation, you can use the ND implementation in the Mathematica package NumericalCalculus` ...

POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract