Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2013-07-22 03:32:39

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

An Integral and the Computer

Can anyone tell how to find the value of the following integral upto four significant digits with the help of a computer but not a readymade CAS?

My first question is : Does cos(x)^100 mean (cos (x))^100 or (cos (x^100)?

Last edited by Agnishom (2013-07-22 03:32:54)


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#2 2013-07-22 04:40:56

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

Hi Agnishom;

It means

You can integrate mostly any integrand using the methods of numerical analysis and a computer. Numerical methods can do way more integrations than even those wonderful analytical methods that they bore kids with.

1) You take a look always at the geometry of the problem. This is done by plotting.

What do you observe?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#3 2013-07-22 04:54:17

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: An Integral and the Computer

How do you find the area of that numerically?

(Please do not take me to Geogebra, for I do not know how Geogebra does it)


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#4 2013-07-22 05:02:32

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: An Integral and the Computer

Hey, I just got an idea! big_smile


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#5 2013-07-22 05:03:22

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

You will need to use of one of the standard ways. Romberg, Gaussian, Newton Cotes, Simpsons, Trapezoidal, Euler Mclaurin Summation etc.

There will be function evaluations, probably a dozen or so. You will need a computer or scientific calculator ( a good one ) to assist you. What will you use?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#6 2013-07-22 05:11:43

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: An Integral and the Computer

You will need to use of one of the standard ways. Romberg, Gaussian, Newton Cotes, Simpsons, Trapezoidal, Euler Mclaurin Summation etc.

What are these?

I have thought of splitting up the figure into minute rectangles each of area y dx. I can put in small values of x in the formula step by step from 0 to π /4 and add 'em up.


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#7 2013-07-22 05:17:55

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

That is the basic method that you will be using for all of the above methods. But you will still have to do the function evaluations...

Also you need 4 digits of precision, that may mean a lot of rectangles! Isn't it better to use one of the standard ways with guaranteed error estimates and convergence?

Anyone can dump lots of rectangles in there like a Riemann integral but basically that is only used as an example for better ideas.

Also, if I may offer some advice at this juncture. Numerical math is best done with powerful computing software. A good violinist, needs a Stradivarius to play beautiful music. A pro bowler has the best balls, gloves, shoes and drilling knowledge to roll the highest scores. A pool player needs a good stick, clean cloth and a good glove to play at his best. A good racer requires a great car to win.  A computational mathematician requires a package to be great. It is his Stradivarius.

For instance:

This was not done by M but by a little routine I wrote for M.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#8 2013-07-22 15:35:24

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: An Integral and the Computer

bobbym wrote:

Numerical math is best done with powerful computing software.

Do you mean a CAS? That I have already done, with another M - Maxima. I am getting:


Please explain me these:

Romberg, Gaussian, Newton Cotes, Simpsons, Trapezoidal, Euler Mclaurin Summation etc.

Last edited by Agnishom (2013-07-22 15:37:47)


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#9 2013-07-22 19:32:45

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

Yes, a CAS is a great tool.

That I have already done, with another M - Maxima

In this case I did not mean using the integrate command. I meant writing a numerical integration routine using one of the above algorithms.

You understand stuffing rectangles underneath curves?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#10 2013-07-22 20:39:35

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: An Integral and the Computer

I think so


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#11 2013-07-22 20:44:07

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

The simplest is the Trapezoid rule. Instead of stuffing rectangles, it is intuitively obvious that stuffing trapezoids will yield better results.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#12 2013-07-22 20:50:33

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: An Integral and the Computer

I agree, so...


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#13 2013-07-22 20:57:55

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

That means less stuffing of trapezoids compared to rectangles. That means less computation which means faster convergence, more numerical stability and happier computers.

Want to see the trapezoidal rule in action?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#14 2013-07-22 21:35:41

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: An Integral and the Computer

Yes, is it something related to simpson?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#15 2013-07-22 21:37:52

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

Simpsons rule is the next thing. It should have replaced the trapezoidal rule but the trapezoidal rule is used inside Romberg integration so it is still around.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#16 2013-07-22 21:39:27

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: An Integral and the Computer

Ok, please put the trap. Rule in action


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#17 2013-07-22 21:55:06

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

There are many variations of it but here is the crudest one just for illustration purposes:

Now for your problem we have:

Now using A) we get:

Can you compute that?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#18 2013-07-22 22:12:18

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: An Integral and the Computer

Are you telling me to plug a and b as 0 and pi/4?

Last edited by Agnishom (2013-07-23 00:54:22)


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#19 2013-07-22 22:13:15

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

Yes, that is correct. But I would like you to do it on your own.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#20 2013-07-22 22:15:55

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: An Integral and the Computer

Ok, but after a while: I am not feeling well right now.


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#21 2013-07-22 22:19:16

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

Okay, I will fill it in for you. You just relax.

That is not very accurate is it? Why is it not?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#22 2013-07-23 00:46:47

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: An Integral and the Computer

I am sorry. I was feeling very weak then, I have a stomach upset.

That is because it is just one trapezium(or just a triangle). We have to put many of them.


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#23 2013-07-23 00:55:25

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

That is okay, I hope you are feeling better. If not then get some rest and we can continue later or tomorrow.

Your answer is correct! We use this formula to get more.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#24 2013-07-23 01:00:38

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: An Integral and the Computer

n is the number of intervals or something like that I suppose?

How do you get this formula?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#25 2013-07-23 01:13:35

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

Hi;

Yes, n is the number of intervals. The formula is derived in a lot of books. I am not that big on memorizing proofs or derivations so I do not recall it offhand. What is important for numerical work is the error estimate and the fact that it works!


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

Board footer

Powered by FluxBB