我有一个功能 f(t)=2/(2-t)
.在不使用 Mathematica 的情况下,在 t=0(即 2^(-r)*r!
)处获得 r 阶导数并不难。在 Mathematica 计算的情况下,当 r=4 时,我可以像这样得到 r 阶导数:D[2/(2-t), {t, 4}]
.但是,当 r 是任何整数时,如何在 Mathematica 中获得 t=0 处的 rth 导数?我尝试使用这个表达式,但它没有按预期工作:
Simplify[D[2/(2 - t), {t, r}], Assumptions -> Element[r, Integers]] /. {t->0}
是否可以像我们人类一样在 Mathematica 中象征性地进行上述数学运算?
最佳答案
对于分析函数,您可以使用 SeriesCoefficient。
nthDeriv[f_, x_, n_] := n!*SeriesCoefficient[f[x], {x, x, n}]
你的例子:
f[t_] := 2/(t - 2)
nthDeriv[f, t, n]
(*
-> Out[39]= n!*Piecewise[{{-2*(2 - t)^(-1 - n), n >= 0}}, 0]
*)
关于wolfram-mathematica - 当 r 在 Mathematica 中是符号时,如何找到函数的 r 阶导数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8278367/