Math Is Fun Forum

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

You are not logged in.

#1 2009-09-06 01:00:43

SgtDawkins
Member
Registered: 2009-09-01
Posts: 9

Trapezoid Rule with Infinite Limits

Hello again.  Another question I've been struggling with (though it probably should be cake) is how to apply the trapezoid rule for area under a curve when the left side of the function is undefined (goes up to infinity).  I'm not allowed to change the limit of integration.  The problem comes, obviously, when trying to compute one of the bases of the left-most trapezoid.  As the function is undefined at that point, I don't know how to get a value.  Hope this question makes sense- I've no formal training in this topic, and can't find information on the topic.  Thanks!

Offline

#2 2009-09-06 01:06:52

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

Re: Trapezoid Rule with Infinite Limits

Hi SgtDawkins;

(though it probably should be cake)

That is not correct. These type of integrals, callled pathological present major challenges to humans and computers alike.

There are many methods to deal with a singularity either on the left or the right. You can subtract off the singularity. You can use the chunk method. You can use other methods besides trapezoidal, ones that don't use the endpoints. There are literally dozens of books and hundreds of papers in numerical analysis that deal with that question. I would have to see the integral to say more.

Last edited by bobbym (2009-09-06 04:15:57)


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 2009-09-06 01:19:44

SgtDawkins
Member
Registered: 2009-09-01
Posts: 9

Re: Trapezoid Rule with Infinite Limits

I HAVE to use the trapezoid rule, and if by subtracting off the singularity you mean change the limit of integration, I'm not allowed to do that.  The function to be integrated is:

(cos(x)dx)/sqrt(x)

from 0 to pi/2

Thanks for the help!

Offline

#4 2009-09-06 01:36:17

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

Re: Trapezoid Rule with Infinite Limits

Hi SgtDawkins;

and if by subtracting off the singularity you mean change the limit of integration

No, it is a term from asymptotic analysis. Treat your integral like this.

I have subtracted off the singularity the 1/√x to try to improve the geometry of the integrand. This is the answer you want.

1.9549028485826594861172411 correct to the full 25 digits.

Last edited by bobbym (2009-09-06 04:18:10)


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

#5 2009-09-06 01:44:13

SgtDawkins
Member
Registered: 2009-09-01
Posts: 9

Re: Trapezoid Rule with Infinite Limits

Ah, right in front of my face!  Thanks so much for your help!

Offline

#6 2009-09-06 01:52:00

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

Re: Trapezoid Rule with Infinite Limits

Hi SgtDawkins;

Whoa, hold it! This is only the beginning. There is much work to be done on that integral. It still is not responding well to the trapezoidal method. I do not consider it tamed enough for the trapezoidal method.

If you graph

and

you will see that mathematically we are done. Their is no longer a severe rise of the function approaching 0. Computer math and human math are different. Newton Cotes formulas of which the trapezoidal is one include the endpoints.

Even though the limit of the above function is 0 as x approaches zero. The computer will still choke when your trapezoidal rule tries to evaluate f(0). There is a workaround for this.

Last edited by bobbym (2009-09-06 08:44:29)


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

#7 2009-09-06 03:06:47

SgtDawkins
Member
Registered: 2009-09-01
Posts: 9

Re: Trapezoid Rule with Infinite Limits

When you told me to split the integral earlier, I plugged it into Maple and it spat out an answer, so I thought "job well done" and left it to go for breakfast.  Now that I've come back to it, I see that the answer involves a fresnel function and that I was premature in my elation.  So I'm open to further advice.  I'm not quite clear on what you are suggesting in your follow up.  I'm going to look into the Newton-Cotes formula.

The exact question asks us to use ten trapezoids to approximate the given integral.  The only prerequisite for the question is that we have knowledge of calculus up to Taylor Series. 

I'm sorry if I am being dense, but I'm admittedly weak in this area.  Thanks for your patience!

Offline

#8 2009-09-06 03:11:41

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

Re: Trapezoid Rule with Infinite Limits

Hi SgtDawkins;

No problem, I will get you through it. Just allow me to complete the work that I am doing on it right now. By the way Maple is correct, it does involve a fresnel integral. Please look at the graphs that I suggested in the earlier post, to understand what subtracting the singularity has done.


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

#9 2009-09-06 03:53:17

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

Re: Trapezoid Rule with Infinite Limits

Hi SgtDawkins;

Split the integral into 2 pieces. Taylor series are only accurate generally from -1 to 1.

Get the Taylor series and truncate it.

Since the new integral is only from 0 to 1/2 it should respond well to a Taylor approximation.

Each of the 3 integrals can now be done exactly or by the trapezoidal rule. Notice the singularity has been removed and is treated separately.

Add em up.

I have only used about 9 digits of precision for brevity. I also have disguised the subtraction of the singularity to look like nothing more than algebra. This meets your requirement of only using a Taylor series. Also the 2nd integral which is just a big polynomial could have been done analytically but I used the trapezoid method instead.

Last edited by bobbym (2009-09-06 04:12:52)


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 2009-09-06 04:54:54

SgtDawkins
Member
Registered: 2009-09-01
Posts: 9

Re: Trapezoid Rule with Infinite Limits

Thank you a million times.  You made it very easy to understand.

Offline

#11 2009-09-06 05:03:07

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

Re: Trapezoid Rule with Infinite Limits

Hi SgtDawkins;

Thats because that is an easy one. Remember that all numerical integration formulas are basically trying to approximate the integrand by a polynomial. Polynomials never approach the x or y axis or anywhere else asymptotically. Therefore the polynomial will be inaccurate there, making the numerical integration difficult. All integrands must be put into a form that is a good fit for a polynomial. In other words nice smooth curves, not too many peaks and values, no asymptotes.

Last edited by bobbym (2009-09-06 09:40:38)


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