Using a power series to approximate a definite integral

Click For Summary

Homework Help Overview

The discussion revolves around using a power series to approximate the definite integral of \(\int \cos(4x) \log x \, dx\) from \(\pi\) to \(2\pi\). Participants explore the implications of the bounds and the challenges of achieving a six-decimal place accuracy in the approximation.

Discussion Character

  • Exploratory, Assumption checking, Problem interpretation

Approaches and Questions Raised

  • Participants discuss breaking down the integral and using power series expansions for \(\sin(4x)\) and \(\log x\). There are questions about how the bounds affect the calculation and the number of terms needed for accuracy. Some suggest integrating the series term by term and considering the convergence of the series.

Discussion Status

The discussion is active, with various approaches being proposed, including shifting the integration variable and expanding logarithmic functions. Some participants express concerns about the number of terms required for convergence and accuracy, while others suggest breaking the integral into smaller intervals for better manageability.

Contextual Notes

There are indications of potential issues with convergence and the need for a significant number of terms to achieve the desired accuracy. The complexity of integrating over a long interval and the behavior of the series at larger values are also under consideration.

wilcofan3
Messages
27
Reaction score
0
How do I go about finishing/calculating this?

Homework Statement


Use a power series to approximate [tex]\int\cos 4x\log x dx[/tex] to six decimal places. (bounds are from pi to 2pi)

Homework Equations


The Attempt at a Solution


So I broke down the equation first:

[tex]\int\cos 4x\log x dx = \frac{1}{4}\sin 4x\log x - \frac{1}{4}\int \frac{\sin 4x}{x}dx[/tex]

Now I am using the fact that [tex]\sin x = \sum_{n=0}^\infty(-1)^n\frac{(4x)^{2n+1}}{(2n+1)!}\Rightarrow \frac{\sin x}{x} = \sum_{n=0}^\infty(-1)^n\frac{4^{2n+1}x^{2n}}{(2n+1)!}[/tex].


This is a really stupid question probably, but I don't understand how to go about finishing the problem even though I think I have the right idea.

What I don't understand is how the bounds play a part in this. Am I just calculating that last series to six decimal places?
 
Physics news on Phys.org
Now you want to integrate the last series dx and approximate it's value at pi and 2*pi to six decimal places. It's an alternating series, so there's a pretty easy error estimate you can use to figure out how many terms to keep.
 
It looks like you will need many terms in this approach. Expanding sin(4x) around zero while you need to integrate it from pi to 2 pi is asking for problems. At x = 2 pi the argument of the Sin is 8 pi = approximately 24. Insert x = 24 in the series expansion for sin(x) to see when the terms get small... I think you need to go as far as n = 40 or so...

Expanding sin(4x) around x = 3/2 pi is better, but it is still not the best way to go about. The interval over which you have to integrate is quite long, you have to integrate over twice the period of the cos function. So, this suggests that you should break up the integral from pi to 2 pi into smaller intervals an then do a power series expansion around the mid point of each interval. You can also try to expand the log instead of the sin or cos.

Another option is to iterate the partial integrations a few times more. I.e. you integrate the sin(4x)/x again by integrating the sin(4x) factor and then you end up with the integral of cos(4x)/x^2. Do this again and you see that you end up with sin(4x)/x^3. Because the power of x in the denominator grows at each step, the integral becomes smaller, at least at first. What you get is a divergent asymptotic expansion. I'm not sure you can get to 6 decimal places before the series starts to diverge, though.
 
There aren't any convergence problems here. sin(4x)/x has an infinite radius of convergence around x=0. Look at the terms in the series and apply the ratio test. And you won't need that many terms. (2n+1)! grows pretty fast.
 
Last edited:
Dick said:
There aren't any convergence problems here. sin(4x)/x has an infinite radius of convergence around x=0. Look at the terms in the series and apply the ratio test. And you won't need that many terms. (2n+1)! grows pretty fast.

Try to compute sin(8 pi) using the power series. Sure, it converges (to zero of course). How many terms do you need? Well, let's simply see for what n we get the largest term in the series. It is easy to see that the function f(n) = lambda^n/n! has a maximum at approximately
n = lambda, if lambda is not too small. Now, 8 pi = approximately 25, so the maximum should occur for n = 12, the term being

(8 pi)^25/25! = approximately 6.5*10^9

So, you clearly do need many terms. That's not the only problem. You also need a result that is quite accurate. This means that you need to evaluate all the terms, including the very large terms, to a sufficient acccuracy. To see that
sin(8pi) is zero to 6 decimal places, you need to keep more than 16 significant figures in the n = 12 term.
 
I would solve the problem as follows. We have

[tex]\int_{\pi}^{2\pi}\cos(4x)\log(x)dx=\frac{1}{4}\int_{4\pi}^{8\pi}\cos(t)\log\left(\frac{t}{4}\right)dt=\int_{4\pi}^{8\pi}\cos(t)\log(t)dt[/tex]

Shift the integration variable to rewrite the integral as:

[tex]\frac{1}{4}\int_{-2\pi}^{2\pi}\cos(6\pi+v)\log(6\pi+v)dv=\frac{1}{4}\int_{-2\pi}^{2\pi}\cos(v)\log(6\pi+v)dv=[/tex]
[tex]\frac{1}{4}\int_{-2\pi}^{2\pi}\cos(v)\log\left(1+\frac{v}{6\pi}\right)dv[/tex]

Expand Log(1+v/(6 pi)) in series and integrate term by term. You need 13 terms to obtain the result:

[tex]\int_{\pi}^{2\pi}\cos(4x)\log(x)dx\approx -9.74251485155\times 10^{-3}[/tex]
 
Last edited:
Count Iblis said:
Try to compute sin(8 pi) using the power series. Sure, it converges (to zero of course). How many terms do you need? Well, let's simply see for what n we get the largest term in the series. It is easy to see that the function f(n) = lambda^n/n! has a maximum at approximately
n = lambda, if lambda is not too small. Now, 8 pi = approximately 25, so the maximum should occur for n = 12, the term being

(8 pi)^25/25! = approximately 6.5*10^9

So, you clearly do need many terms. That's not the only problem. You also need a result that is quite accurate. This means that you need to evaluate all the terms, including the very large terms, to a sufficient acccuracy. To see that
sin(8pi) is zero to 6 decimal places, you need to keep more than 16 significant figures in the n = 12 term.

You are right. 8pi is too large to make the series manageable. Looks like you do need to break the expansion into smaller intervals.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 105 ·
4
Replies
105
Views
11K