# Troublesome output of summation's derivative

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

• First, I see no reason to expect a simple closed form for that problem, given that you are not defining FFunc. Second, never use uppercase variable names, as you will likely use reserved symbols inadvertently, like you did using N. Change to n. 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. Commented Jul 10 at 13:19
• Hi @rhermans, thank you very much for the suggestion. I have updated the question to fix the issues you pointed out and show that your solution handles the complex number problem. Yet, Kronecker deltas are still there, and I have no clue how to eliminate them and improve the readability of the solution.
– FDP
Commented Jul 10 at 13:53