Message Boards Message Boards

0
|
4402 Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Explicit derivatives

Hey there i have defined this function: G[x_] := Log[x] and the nth derivative fnm[x, n] := Derivative[n][g][x]. When i try to print fnm[x, n], i just get the general answer g^(n)[x]. I am undable to get the answer as an explicit function in x. The furmulas are correct as i am able to get correct numeric results from them. What shall i do ?

Regards Andreas Ø (new user)

POSTED BY: Andreas Madsen
4 Replies
POSTED BY: Nasser M. Abbasi

That worked! Thank you very much :)

POSTED BY: Andreas Madsen
POSTED BY: Andreas Madsen

Derivative returns derivative function, which you then pass it the variable. So I would do it like this (I am assuming you are trying to define fnm to use for different functions.

G0 = Log;
fnm[fun_, n_] := Derivative[n][fun]

And now to use it

  fnm[G0, 2][x]
  (*-1/x^2*)
  fnm[G0, n][x]
  Derivative[n][Log][x]
   %/.n->3
  (*2/x^3*)
  fnm[Sin, 3][x]  (*etc....*)

If you just write fnm[G0, 2] you'll get -(1/#1^2) &

POSTED BY: Nasser M. Abbasi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract