# make computation of derivative of list of functions as fast as possible

Suppose i have list of function like below:

F = Table[Sum[(i + 4) x^m + i*y^n + (j + 3) x^(m + 4)*y^(n - 2), {m, 40}, {n,40}], {i, 40}, {j, 40}]


and i want to take derivative like below

Laplacian[F, {x, y}]


Is there any way to take derivative as fast as possible(My main functions and derivatives are so complex than what we mention here)

• Can you post your "main function"? This would enable a much better effort to help. – MikeY Jun 29 '17 at 19:17

In the example you give, the problem is linear and so you can move the Laplacian into the problem and compute it once. If this holds for your more complicated problem, this can help.

term = (i + 4) x^m + i*y^n + (j + 3) x^(m + 4)*y^(n - 2);

lapterm = Laplacian[term, {x, y}];

lt = Laplacian[
Table[Sum[term, {m, 20}, {n, 20}], {i, 20}, {j, 20}], {x,
y}]; // Timing

(*   3.588  *)

tl = Table[
Sum[lapterm, {m, 20}, {n, 20}], {i, 20}, {j, 20}]; // Timing

(*    1.912    *)

lt == tl

(*    True    *)