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

You are not logged in.

## #1 2013-07-23 01:32:39

Agnishom
Real Member

Offline

### 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-23 01: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'
'The whole person changes, why can't a habit?' -Alokananda

## #2 2013-07-23 02:40:56

bobbym

Offline

### 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.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #3 2013-07-23 02:54:17

Agnishom
Real Member

Offline

### 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'
'The whole person changes, why can't a habit?' -Alokananda

## #4 2013-07-23 03:02:32

Agnishom
Real Member

Offline

### Re: An Integral and the Computer

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'
'The whole person changes, why can't a habit?' -Alokananda

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

bobbym

Offline

### 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.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #6 2013-07-23 03:11:43

Agnishom
Real Member

Offline

### 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'
'The whole person changes, why can't a habit?' -Alokananda

## #7 2013-07-23 03:17:55

bobbym

Offline

### 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.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #8 2013-07-23 13:35:24

Agnishom
Real Member

Offline

### 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:

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

Last edited by Agnishom (2013-07-23 13: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'
'The whole person changes, why can't a habit?' -Alokananda

## #9 2013-07-23 17:32:45

bobbym

Offline

### 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.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #10 2013-07-23 18:39:35

Agnishom
Real Member

Offline

### 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'
'The whole person changes, why can't a habit?' -Alokananda

## #11 2013-07-23 18:44:07

bobbym

Offline

### 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.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #12 2013-07-23 18:50:33

Agnishom
Real Member

Offline

### 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'
'The whole person changes, why can't a habit?' -Alokananda

## #13 2013-07-23 18:57:55

bobbym

Offline

### 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.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #14 2013-07-23 19:35:41

Agnishom
Real Member

Offline

### 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'
'The whole person changes, why can't a habit?' -Alokananda

## #15 2013-07-23 19:37:52

bobbym

Offline

### 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.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #16 2013-07-23 19:39:27

Agnishom
Real Member

Offline

### 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'
'The whole person changes, why can't a habit?' -Alokananda

## #17 2013-07-23 19:55:06

bobbym

Offline

### 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.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

## #18 2013-07-23 20:12:18

Agnishom
Real Member

Offline

### 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 22: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'
'The whole person changes, why can't a habit?' -Alokananda

## #19 2013-07-23 20:13:15

bobbym

Offline

### 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.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

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

Agnishom
Real Member

Offline

### 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'
'The whole person changes, why can't a habit?' -Alokananda

## #21 2013-07-23 20:19:16

bobbym

Offline

### 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.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

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

Agnishom
Real Member

Offline

### 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'
'The whole person changes, why can't a habit?' -Alokananda

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

bobbym

Offline

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

In mathematics, you don't understand things. You just get used to them.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.

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

Agnishom
Real Member

Offline

### 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'
'The whole person changes, why can't a habit?' -Alokananda

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

bobbym

Offline

### 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.
Some cause happiness wherever they go; others, whenever they go.
If you can not overcome with talent...overcome with effort.