Numerical integration of sharply peaking functions

In summary, the homework statement asks for a solution to an integration problem without a calculator. The student attempted to approximate the function by writing it as a power series and then keeping just the three terms that are most important. The approximation is approximately equal to the first region but ignores all the rest.
  • #1
says
594
12

Homework Statement


∫ e1000((sinx)/x) dx [0 to 1000 : bound of integration]. Solve this integral of a sharply peaked function without a calculator.

Homework Equations


I'm doing this in relation to statistical thermodynamics - I think I need to use Sterling's Approximation or a gamma function. I'm not really sure how to go about it though. I've had a look at a few definitions of both and they seem a bit too rigorous to grasp yet.

The Attempt at a Solution

 
Physics news on Phys.org
  • #2
I can't tell from your problem description what method your instructor wants you to use. However, one way is to write ##\frac{1000 sin(x)}{x}## as a power series:

##\frac{1000 sin(x)}{x} = A + Bx + Cx^2 + ...##

You can then approximate the function by just keeping those three terms (figure out what ##A##, ##B## and ##C## are). Then the problem reduces to figuring out ##\int_0^{1000} e^{Cx^2} dx## (##C## will turn out to be negative). Is that approximately equal to some known integral?
 
  • #3
stevendaryl said:
I can't tell from your problem description what method your instructor wants you to use. However, one way is to write ##\frac{1000 sin(x)}{x}## as a power series:

##\frac{1000 \sin(x)}{x} = A + Bx + Cx^2 + ...##

You can then approximate the function by just keeping those three terms (figure out what ##A##, ##B## and ##C## are). Then the problem reduces to figuring out ##\int_0^{1000} e^{Cx^2} dx## (##C## will turn out to be negative). Is that approximately equal to some known integral?
Actually the function ##\exp(1000\frac{\sin x}{x})## approaches unity as x goes to ##\pm \infty## which means its integral over all space is divergent. On the other hand the integral over all space of the approximated function as suggested above is convergent.
 
  • #4
blue_leaf77 said:
Actually the function ##\exp(1000\frac{\sin x}{x})## approaches unity as x goes to ##\pm \infty## which means its integral over all space is divergent. On the other hand the integral over all space of the approximated function as suggested above is convergent.

You're right. That doesn't work. The approach I was suggesting only works if the integrand rapidly goes to zero, in which case, you can approximate it by looking at its behavior near ##x=0## (or some other stationary point).

The integral looks something like this:
  • The function starts out absolutely huge: ##e^{1000}##.
  • It drops to almost zero at ##x = \frac{3\pi}{2}##
  • It goes back up to another huge number: ##e^{1000 \frac{2}{5\pi}}##
  • It goes back to almost zero at ##x = \frac{7\pi}{2}##
  • It continues going up and down, with the ups getting smaller and smaller and the downs getting larger and larger, until near ##x=1000##, the function is just meandering up and down between the values ##e^0## and ##e^1##.
The approximation that I gave is roughly equal to the first region (colored in gray), up to ##x= \frac{3\pi}{2}##. But it ignores all the rest. However, we can get an estimate for all the rest, in that it's certainly less than ##1000 e^{1000 \frac{2}{5\pi}}##. So if the area of the first region turns out to be really huge compared to this number, then I think my approximation will be close.

integral.jpg
 

Attachments

  • integral.jpg
    integral.jpg
    9.9 KB · Views: 545
Last edited:
  • #5
stevendaryl said:
I can't tell from your problem description what method your instructor wants you to use. However, one way is to write ##\frac{1000 sin(x)}{x}## as a power series:

##\frac{1000 sin(x)}{x} = A + Bx + Cx^2 + ...##

You can then approximate the function by just keeping those three terms (figure out what ##A##, ##B## and ##C## are). Then the problem reduces to figuring out ##\int_0^{1000} e^{Cx^2} dx## (##C## will turn out to be negative). Is that approximately equal to some known integral?

i know that ##\int_{-∞}^{∞} e^{-Cx^2} dx = √(π/C) ## but I'm not really sure where to go from there...
 
  • #6
If I represent ## 1000sin(x)/x ## as a taylor series it equals
## 1000 - (500x^2/3) + (25x^4/3) ##

## ∫e^(1000sin(x)/x) = ∫e^(1000-500x^2/3+25x^4/3) ##

## ∫ exp(1000) dx + ∫ exp(-500x^2/3) dx + ∫ exp(25x^4/3) dx ##
 
  • #7
Ok, so I understand the problem a bit more now.

The integral is a sharply peaking function that decays rapidly. All that contributes to the result is the area under the function close to the origin. Instead of doing an expansion of the sharp function, I'm supposed to do one of it's smaller varying logarithmic function. Once I've done that I can expand that function, put it back in the integral and get the result...
 
  • #8
## ln (exp(1000(sin(x)/x)) ##
## = 1000(sin(x)/x) ##

series expansion of sin(x) = ## x - x^3/3! + x^5/5! ... + ((-1)^n(x)^(2n+1) )/ (2n+1)! ##

divide by x to obtain series expansion of sin(x) / x

## sin(x) / x = 1 - x^2/3! + x^4/5! - x^6/7! ##

I think that is the correct expansion - from here on I'm not so sure. I put the expansion back into the integral

## ∫ ln(exp(1000(sinx/x)) dx = ∫ 1000(sinx/x) dx = 1000 ∫ 1 - x^2/3! + x^4/5! - x^6/7! dx ##

[bounds of integration are 0 to ln(1000)] not sure if I apply the log to the bound as well...

## = 1000 [ x - x^3/18 + x^5/600 - x^7/35280 ] ##

## = 1000 [ ln(1000) - ln(1000)^3/18 + ln(1000)^5/600 - ln(1000)^7/35280 ] - 0 ##

## = 1000 [ ln(1000) - ln(1000)^3/18 + ln(1000)^5/600 - ln(1000)^7/35280 ] ##
 
  • #9
says said:
If I represent ## 1000sin(x)/x ## as a taylor series it equals
## 1000 - (500x^2/3) + (25x^4/3) ##

## ∫e^(1000sin(x)/x) = ∫e^(1000-500x^2/3+25x^4/3) ##

## ∫ exp(1000) dx + ∫ exp(-500x^2/3) dx + ∫ exp(25x^4/3) dx ##

No, ##1000 \sin(x)/x## is not equal to what you wrote. Those are merely the first three terms in the infinite series, and so what you wrote is almost OK for small ##x##, say for ##0 < x < \pi/2##. The errors get worse and worse as you go to larger ##x##, so already by the time you reach ##x = \pi## the errors are perhaps unacceptably large, and they become very bad indeed for still larger ##x##.
 
  • #10
Ok, so I made anther attempt. As mentioned in post #7, I've taken the natural log of the function. I've then used a taylor series for sin(x)/x

## ln (exp(1000(sin(x)/x)) ##

## = 1000(sin(x)/x) ##

## (sin(x)/x) = ∑ (-1)^n x^{2n} / (2n+1)! ##

## 1000 ∫ ∑ (-1)^n x^{2n} / (2n+1)! ##

## 1000 ∑ [ (-1)^n x^{2n+1} / (2n+1) (2n+1)! ] ## | evaluating from 0 to 1000

I'm not sure what I would sum 'n' to though?
 
  • #11
says said:
Ok, so I made anther attempt. As mentioned in post #7, I've taken the natural log of the function. I've then used a taylor series for sin(x)/x

## ln (exp(1000(sin(x)/x)) ##

## = 1000(sin(x)/x) ##

## (sin(x)/x) = ∑ (-1)^n x^{2n} / (2n+1)! ##

## 1000 ∫ ∑ (-1)^n x^{2n} / (2n+1)! ##

## 1000 ∑ [ (-1)^n x^{2n+1} / (2n+1) (2n+1)! ] ## | evaluating from 0 to 1000

I'm not sure what I would sum 'n' to though?

I don't think that expanding it out to a polynomial is helpful, because if quadratic or higher powers of ##x## are included, you cannot write down an exact value anyway, I think you need to go numerical all the way, right from the start.

If I were doing it I would write the integral as ##e^{1000} \int_0^{1000} \exp \left( 1000 \frac{\sin x}{x} - 1000 \right) \, dx,## because the function ##f(x) = \exp(1000(-1+\sin(x)/x))## starts off at ##f(0)=1## and drops rapidly to zero; it is about ##10^{-434}## by the time you get to ##x = \pi.## It remains at or below that level for all ##x > \pi.##
 
  • #12
I've been told to do an expansion of the function's natural logarithm though, and then put that back into the integral. I understand what you mean in regards to higher orders of x though
 
  • #13
I don't understand why when I put the integral into wolfram I get an answer of 1.35*10433, however when I put the integral into my calculator I get an answer of 1.14*109.
 

1. What is numerical integration?

Numerical integration is a method used to approximate the value of a definite integral, which is the area under a curve on a graph. It involves dividing the area into smaller, known shapes and summing up their areas to get an estimate of the total area.

2. What are sharply peaking functions?

Sharply peaking functions are mathematical functions that have a very narrow and steep peak compared to the rest of the curve. These functions pose a challenge for numerical integration as they require a large number of smaller shapes to accurately estimate the area under the curve.

3. Why is numerical integration difficult for sharply peaking functions?

Numerical integration is difficult for sharply peaking functions because the steep peak causes the function to rapidly fluctuate, making it hard to accurately estimate the area under the curve using a small number of shapes. This can lead to a higher error in the approximation.

4. What are some techniques used for numerical integration of sharply peaking functions?

Some techniques that can be used for numerical integration of sharply peaking functions include adaptive quadrature methods, which adapt the size and location of the smaller shapes based on the function's behavior, and Gaussian quadrature, which uses a weighted sum of function values at specific points to approximate the integral.

5. How can I improve the accuracy of numerical integration for sharply peaking functions?

To improve the accuracy of numerical integration for sharply peaking functions, you can use a higher number of smaller shapes, use adaptive quadrature methods, or choose a more appropriate integration technique for the specific function. It is also helpful to consider the behavior of the function and choose an appropriate integration interval to minimize the error.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
2K
Replies
10
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
1K
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
2K
Back
Top