当Mathematica中的r为符号时,如何找到函数的rth导数? [英] How to find a function's rth derivative when r is symbolic in Mathematica?
问题描述
我有一个功能f(t)=2/(2-t)
.在不使用Mathematica的情况下,很难在t = 0处获得rth导数(即2^(-r)*r!
).在Mathematica计算的情况下,当r = 4时,我可以得到第r个导数,如下所示:D[2/(2-t), {t, 4}]
.但是,当r为ANY整数时,如何在Mathematica中的t = 0处获得rth导数?我尝试使用此表达式,但未按预期工作:
I have a function f(t)=2/(2-t)
. It is not so hard to get the rth derivative at t=0 (i.e. 2^(-r)*r!
) without using Mathematica. In the case of Mathematica calculation, I can get the r-th derivative when r=4 like this: D[2/(2-t), {t, 4}]
. But how can I get the rth derivative at t=0 in Mathematica when r is ANY integer? I tried to use this expression, but it didn't work as expected:
Simplify[D[2/(2 - t), {t, r}], Assumptions -> Element[r, Integers]] /. {t->0}
是否有可能像人类一样在Mathematica中象征性地进行上述数学运算?
Is it possible to do the above math symbolically in Mathematica just as we humans do?
推荐答案
f = FindSequenceFunction[Table[D[2/(2 - t), {t, n}], {n, 1, 5}], r]
(*
-> -((2 (2 - t)^-r Pochhammer[1, r])/(-2 + t))
*)
g[r_, t_] := f
FullSimplify@FindSequenceFunction[Table[g[r, t], {r, 1, 5}] /. t -> 0]
(*
-> 2^-#1 Pochhammer[1, #1] &
*)
修改
或者只是
FindSequenceFunction[Table[D[2/(2 - t), {t, n}], {n, 1, 5}], r] /. t -> 0
(*
-> 2^-r Pochhammer[1, r]
*)
* 编辑*
注意:尽管FindSequenceFunction[]
在这种简单情况下可以工作,但在更一般的情况下请勿押注.
Note: While FindSequenceFunction[]
works in this simple situation, don't bet on it in more general cases.
修改
要获得以阶乘函数表示的结果,只需执行以下操作:
To get the result expressed in terms of the factorial function, just do:
FunctionExpand@FindSequenceFunction[Table[D[2/(2-t),{t, n}],{n,1,5}], r] /.t->0
(*
-> 2^-r Gamma[1 + r]
*)
这篇关于当Mathematica中的r为符号时,如何找到函数的rth导数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!