# Formal Differentiation

I'm trying to formally differentiate an expression. (I am aware of how to differentiate formally?, but am unable to generalize the idea)

For example:

tmp1 = Sum[Product[MyVal[i, j]^(1/n), {j, 1, n}], {i, 1, n}]


I would like to take the derivative with respect to some i in 1...n and j in 1...n . I thought I could specify something like

MyVal /: D[MyVal[i_, j_], MyVal[k_, l_], NonConstants -> {MyVal}] :=
KroneckerDelta[i, k]*KroneckerDelta[j, l]


Then take the derivative

D[tmp1, MyVal[i, j]]


But this turns out not to work as expected. Any help in the right direction is appreciated. Thanks.

Unfortunately, I think formal differentiation of Product only works if you specify a numerical value for the limit n:

For example,

tmp = With[{n = 3},
Sum[Product[MyVal[i, j]^(1/n), {j, 1, n}], {i, 1, n}]];

FullSimplify[D[tmp, MyVal[i1, j1], NonConstants -> {MyVal}]] • Ah, so it does have some logic for Product, but won't go far enough. I guess I'll have to do some of this by hand still! Jun 19, 2015 at 21:35
• Since nothing else has come along, I'll go ahead and accept this. Jun 22, 2015 at 5:17