I want to numerically calculate a sum with multiple variables and then integrate the whole expression. Any solutions to speed up the process?

NIntegrate[Sum[f[k1, k2, k3, k4, k5, k6, k7, t1], {k1, 1, n}, {k2, 1, n}, {k3, 1, n}, {k4, 1, n}, {k5, 1, n}, {k6, 1, n}, {k7, 1, n}], {t1, 0, t}]

Here n is positive integer, and t is a given time. For large n, there are so many terms......

  • 2
    $\begingroup$ It really depends on the form of f. Generally, summation and integration can be interchanged, and so you could try to integrate each term f[...] analytically or numerically (with memoization) before summing. $\endgroup$
    – Roman
    Oct 21 '21 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.