I am trying to compute a derivative of a nested sum, but I can't avoid Mathematica to output Kronecker deltas and unexpected cases on complex numbers.
Consider the following setting:
L[t_] := Sum[\[Psi][t - a, a]*n[t - a]*\[Theta]*
l[\[Theta], t, a]*\[CapitalTheta][\[Theta]], {\[Theta], 1, m}, {a,
0, j - 1}]
F[Ka_, L_] := FFunc[Ka, L]
FL[Ka_, L_] := D[F[Ka, L], L]
Pension[\[Theta]_, t_, a_] := \[Kappa][t - a]*\[Theta]*
Sum[FL[Ka[t - a + z - 1], L[t - a + z]]*
l[\[Theta], t - a + z, z], {z, 0, jw - 1}]
Here, I compute the derivative of the summation of Pension
over \[Theta]
, t
, and a
, trying to simplify it as much as possible and clearly stating that variables are integers. Note that no complex number is involved anywhere in my problem's domain.
Assuming[{1 <= \[Theta] < m, 0 <= t < \[Infinity], 0 <= a <= j - 1,
j > 1, Element[{\[Theta], t, a}, Integers]},
FullSimplify[
D[Sum[Pension[\[Theta], t, a], {\[Theta], 1, m}, {t, -Infinity,
Infinity}, {a, 0, j - 1}], l[\[Theta], t, a]]]]
Here is the screenshot (for readability) of the output:
As you can see, the expression contains cases in the realm of complex numbers and Kronecker deltas. I would like to get rid of both to have a more streamlined and more transparent derivative.
Update: thanks to @rhermans' suggestion in the comments, I solved the complex-numbers issue by handling the domain more explicitly with [\Element]
. Yet, the problem with the deltas remains.
Now, the output of the call
Assuming[{1 <= \[Theta] < m, 0 <= t < \[Infinity], 0 <= a <= j - 1,
j > 1 , \[Theta] \[Element] Integers, t \[Element] Integers,
a \[Element] Integers},
FullSimplify[
D[Sum[Pension[\[Theta], t, a], {\[Theta], 1, m}, {t, 0,
Infinity}, {a, 0, j - 1}], l[\[Theta], t, a]]]]
looks like the following
FFunc
. Second, never use uppercase variable names, as you will likely use reserved symbols inadvertently, like you did usingN
. Change ton
. Third, if all variables will always be Reals, then add to the assumptions_Symbol \[Element] Reals
, as explained here. Fix that first and edit your question to update it to a question that acknowledges these basic issues. $\endgroup$