1
$\begingroup$

I want to evaluate an integral of form given below

$$\int\limits_\alpha^\beta (f(x) + g(x) + h(x) + ...) dx$$

When I give it to Mathematica it takes forever to evaluate. But if I give it in this form

$$\int\limits_\alpha^\beta f(x)dx + \int\limits_\alpha^\beta g(x)dx + \int\limits_\alpha^\beta h(x)dx + ...$$

It takes comparatively lesser time.

According to this page it can be defined as

integrate[y_ + z_, x_] := integrate[y, x] + integrate[z, x] 

for two variables. But I want to be able to do this for arbitrary number of variables. How to is the question.

  • 0
    Perhaps you could list your functions as $f_1, f_2, \ldots$ instead of $f(x), g(x), \ldots$ and set mathematica up to read it as $\displaystyle\sum_{i=1}^n \displaystyle\int_{\alpha}^{\beta} f_i(x) dx$? I don't have the mathematica skill to tell you the exact code, though.2011-07-19
  • 0
    I got it `integrate[y_ + z_, x_] := integrate[y, x] + integrate[z, x]` is recursively defined. It takes care of arbitrary summation number of functions. Now my problem is that `integrate` does not `Integrate`.2011-07-19
  • 1
    I tried `integrate := Integrate` and wow!! it worked!2011-07-19

2 Answers 2