You are not logged in.

- Topics: Active | Unanswered

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'

'But our love is like the wind. I can't see it but I can feel it.' -A Walk to remember

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,081

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.**

Offline

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'

'But our love is like the wind. I can't see it but I can feel it.' -A Walk to remember

Offline

Hey, I just got an idea!

'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'

'But our love is like the wind. I can't see it but I can feel it.' -A Walk to remember

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,081

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.**

Offline

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.

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'But our love is like the wind. I can't see it but I can feel it.' -A Walk to remember

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,081

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.**

Offline

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)*

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'But our love is like the wind. I can't see it but I can feel it.' -A Walk to remember

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,081

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.**

Offline

I think so

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'But our love is like the wind. I can't see it but I can feel it.' -A Walk to remember

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,081

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.**

Offline

I agree, so...

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'But our love is like the wind. I can't see it but I can feel it.' -A Walk to remember

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,081

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.**

Offline

Yes, is it something related to simpson?

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'But our love is like the wind. I can't see it but I can feel it.' -A Walk to remember

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,081

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.**

Offline

Ok, please put the trap. Rule in action

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'But our love is like the wind. I can't see it but I can feel it.' -A Walk to remember

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,081

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.**

Offline

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

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

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'But our love is like the wind. I can't see it but I can feel it.' -A Walk to remember

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,081

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.**

Offline

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

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'But our love is like the wind. I can't see it but I can feel it.' -A Walk to remember

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,081

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.**

Offline

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.

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'But our love is like the wind. I can't see it but I can feel it.' -A Walk to remember

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,081

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.**

Offline

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

How do you get this formula?

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'But our love is like the wind. I can't see it but I can feel it.' -A Walk to remember

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 98,081

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.**

Offline