1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Using a power series to approximate a definite integral

  1. Mar 7, 2009 #1
    How do I go about finishing/calculating this?

    1. The problem statement, all variables and given/known data
    Use a power series to approximate [tex]\int\cos 4x\log x dx[/tex] to six decimal places. (bounds are from pi to 2pi)

    2. Relevant equations
    3. 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?
  2. jcsd
  3. Mar 7, 2009 #2


    User Avatar
    Science Advisor
    Homework Helper

    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.
  4. Mar 7, 2009 #3
    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.
  5. Mar 7, 2009 #4


    User Avatar
    Science Advisor
    Homework Helper

    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: Mar 7, 2009
  6. Mar 8, 2009 #5
    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.
  7. Mar 8, 2009 #6
    I would solve the problem as follows. We have


    Shift the integration variable to rewrite the integral as:


    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: Mar 8, 2009
  8. Mar 8, 2009 #7


    User Avatar
    Science Advisor
    Homework Helper

    You are right. 8pi is too large to make the series manageable. Looks like you do need to break the expansion into smaller intervals.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Using a power series to approximate a definite integral