0
$\begingroup$

I need help to write the following expression (only 1 iteration):

f(x) = ...some basic function...

f[X0,...,Xp] = f(p)(x0) / p!

What I have so far:

f[x_] := ...some basic function...
MyFunc[f_, arr_, i_, 
p_] := (D[ f[arr[[0]] ], {arr[[0]], p} ]) / p!;

Any help would be greatly appreciated!

$\endgroup$
0
$\begingroup$

Try this:

MyFunc[y__] := (D[f[x], {x, Length[{y}]}]/(Length[{y}])!) /. 
  x -> First[{y}]

Example:

    f[x_] := Sin[x]

    MyFunc[3, 5]

    (*-(Sin[3]/2)*)
$\endgroup$
4
  • $\begingroup$ Could you explain (or give url) what is "/." and "->"? $\endgroup$ Jan 3 '15 at 12:04
  • $\begingroup$ This is ReplaceAll function. reference.wolfram.com/language/ref/ReplaceAll.html $\endgroup$ Jan 3 '15 at 12:07
  • $\begingroup$ ah, now I get it, thanks :) $\endgroup$ Jan 3 '15 at 12:12
  • 1
    $\begingroup$ Even after a few years of using Mathematica, I sometimes am confused by strings of @, etc. Such syntax is listed here. $\endgroup$
    – bbgodfrey
    Jan 3 '15 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.