Trying to calculate an integral

  • Mathematica
  • Thread starter Mr Davis 97
  • Start date
  • Tags
    Integral
In summary, the conversation discusses how to compute a specific integral in Mathematica and provides various approaches to solving it. The final result is that the integral equals 20, and the conversation also mentions a general result for integrals involving Pochhammer symbols.
  • #1
Mr Davis 97
1,462
44
This is actually a WolframAlpha question, but I suppose someone conversant in mathematica could give me an answer. How in Mathematica could I compute ##\displaystyle \int_0^1 \left( \prod_{r=1}^3 (x+r)\right) \left(1+x \sum_{r=1}^3 \frac{1}{x+r} \right) ~ dx##. I tried int (Product[x+r, {r, 1}])*(1+ x*(Sum[1/(x+r), {r, 1}])) dx from 0 to 1, but that just gives an errror.
 
Physics news on Phys.org
  • #2
Mr Davis 97 said:
This is actually a WolframAlpha question, but I suppose someone conversant in mathematica could give me an answer. How in Mathematica could I compute ##\displaystyle \int_0^1 \left( \prod_{r=1}^3 (x+r)\right) \left(1+x \sum_{r=1}^3 \frac{1}{x+r} \right) ~ dx##. I tried int (Product[x+r, {r, 1}])*(1+ x*(Sum[1/(x+r), {r, 1}])) dx from 0 to 1, but that just gives an errror.
Looks like you have only specified the lower limits of the sum and product (1), but no the upper limits (3).
 
  • #3
tnich said:
Looks like you have only specified the lower limits of the sum and product (1), but no the upper limits (3).
Oh. I meant int (Product[x+r, {r, 3}])*(1+ x*(Sum[1/(x+r), {r, 3}])) dx from 0 to 1. But this doesn't work either... Everything works when I remove that x right by the sum, but doesn't work when I add it in.
 
  • #4
Mr Davis 97 said:
Oh. I meant int (Product[x+r, {r, 3}])*(1+ x*(Sum[1/(x+r), {r, 3}])) dx from 0 to 1. But this doesn't work either... Everything works when I remove that x right by the sum, but doesn't work when I add it in.
Try putting the ##x## inside the sum.
 
  • #5
tnich said:
Try putting the ##x## inside the sum.
It looks to me like the integral doesn't converge. Try doing the integral analytically (using the calculus) instead of numerically (using Mathematica) and see what you get.
 
  • #6
tnich said:
It looks to me like the integral doesn't converge. Try doing the integral analytically (using the calculus) instead of numerically (using Mathematica) and see what you get.
Now I'm not sure that it doesn't converge, but still, multiply out the terms in the integral, do the integration, and see what you get. Then you will know if your are getting the right answer from Mathematica.
 
  • #7
^It is a polynomial it converges.

Try one of these

Integrate[x (x + 1) (x + 2) (x + 3) (1/x + 1/(x + 1) + 1/(x + 2) + 1/(x + 3)), {x, 0, 1}]
Integrate[Product[x + y, {y, 3}] (1 + x Sum[1/(x + z), {z, 3}]), {x, 0, 1}]
Integrate[Sum[Product[x + y, {y, 0, 3}]/(x + z), {z, 0, 3}], {x, 0, 1}]
Integrate[Product[x + y, {y, 3}] Sum[x/(x + z), {z, 0, 3}], {x, 0, 1}]
Integrate[Sum[Pochhammer[x, 4]/(x + z), {z, 0, 3}], {x, 0, 1}]
Does anyone know a shorter way than five?

int (Product[x + r, {r, 1}])*(1 + x*(Sum[1/(x + r), {r, 1}])) dx
Integrate[Product[x + r, {r, 3}] (1 + x*(Sum[1/(x + r), {r, 3}])), {x, 0, 1}]
is the closest Mathematica form to what you wrote Wolframalpha has less strict syntax.
 
  • Like
Likes tnich
  • #8
I don't understand why you need a numerical approach. Expand your integrand:
$$\int_{0}^1( 4x^3+18x^2 + 22x +6)dx=20$$

Peace,
Fred
 
  • #9
Fred Wright said:
I don't understand why you need a numerical approach. Expand your integrand:
$$\int_{0}^1( 4x^3+18x^2 + 22x +6)dx=20$$

Peace,
Fred
I get the same integrand, but 24 for the numerical result.
 
  • #10
tnich said:
I get the same integrand, but 24 for the numerical result.
Your right--my bad. I'm getting too old to integrate polynomials in my head.:sorry:

Peace,
Fred
 
  • #11
Fred Wright said:
I don't understand why you need a numerical approach. Expand your integrand:
$$\int_{0}^1( 4x^3+18x^2 + 22x +6)dx=20$$

Peace,
Fred
You used a numerical approach as 20 is a (wrong) number.
Integration by parts or substitution can be used to avoid expanding the polynomial.
That reminds me of a nice thing
general result
Differences[Pochhammer[{0, 1}, n]]
Integrate[D[Pochhammer[x, n], x], {x, 0, 1}]
##\int_0^1\mathrm{d}(x)_n=(1)_n-(0)_n=n!##
specific n=4
Differences[Pochhammer[{0, 1}, 4]]
Integrate[D[Pochhammer[x, n], x], {x, 0, 1}]
##\int_0^1\mathrm{d}(x)_4=(1)_4-(0)_4=4!##
 

1. What is an integral?

An integral is a mathematical concept that represents the area under a curve on a graph. It is used to find the total value of a continuous function over a specific interval.

2. Why is calculating an integral important?

Integrals are important because they allow us to find the total value of a function, which can be useful in various real-world applications such as calculating areas, volumes, and probabilities.

3. How do I calculate an integral?

To calculate an integral, you can use various methods such as the fundamental theorem of calculus, integration by substitution, or integration by parts. It is important to understand the properties and rules of integrals to solve them correctly.

4. What is the notation used for integrals?

The notation used for integrals is ∫f(x)dx, where f(x) is the function being integrated and dx represents the variable of integration. The integral symbol (∫) is like an elongated S and is called the integral sign.

5. What are the common mistakes when calculating an integral?

Some common mistakes when calculating an integral include forgetting to add the constant of integration, incorrect use of the integration rules, and not properly evaluating the limits of integration. It is important to double-check your work and be familiar with the properties of integrals to avoid these mistakes.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
997
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
Replies
4
Views
347
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
Back
Top