# Defining a derivative as a function [duplicate]

I'm trying to define the following function

Df[k_, t_, x_, M_] = 1/Factorial[k] D[Exp[-(4 M x t)/(1 - t)], {t, k}]


I want to differentiate that exponential with respect to t k times but I also want to attribute a value to t after the derivation. But when I call this function with the arguments

Df[1,0,1,1]


for example I get a message saying that zero is not a valid variable. I think it is making t=0 before the derivation. Is there anyway around this?

Thank you very much.

## marked as duplicate by J. M. will be back soon♦Oct 12 '16 at 15:46

• Define it like this: Df[k_, t_, x_, M_] := 1/Factorial[k] D[Exp[-(4 M x t0)/(1 - t0)], {t0, k}] /. t0 -> t. (This is a dupe, but I have not time to search.) – march Oct 12 '16 at 15:41
• Try SeriesCoefficient[Exp[-(4 M x \[FormalT])/(1 - \[FormalT])], {\[FormalT], t, k}]. – J. M. will be back soon Oct 12 '16 at 15:45

Df[k_, t_, x_,  M_] := (1/Factorial[k] D[Exp[-(4 M x tt)/(1 - tt)], {tt, k}]) /.  tt -> t

In=  Df[1, 0, 1, 1]