Results 1 to 6 of 6

Math Help - Numerical analysis, calculating an integral exactly for some polynomials

  1. #1
    MHF Contributor arbolis's Avatar
    Joined
    Apr 2008
    From
    Teyateyaneng
    Posts
    1,000
    Awards
    1

    Numerical analysis, calculating an integral exactly for some polynomials

    The problem reads "I must calculate \int _{-1}^1 f(x)x^2 dx via a quadrature rule of the form \int _{-1}^1 f(x)x^2 dx ~A_0 f (x_0)+A_1 f(x_1) that is exact for polynomials with degree lesser or equal to 3."
    Attempt: Not much. I don't understand why use the "f(x)" in the expression. Does this mean that f(x) is a polynomial of degree lesser or equal to 1?

    The expression must be exact for polynomials up to degree 3. It's equivalent to say it must be exact for f(x)x^2= 1, x, x^2 and x^3. This makes f(x)=\frac{1}{x^2}, \frac{1}{x}, 1 and x.
    Evaluating the expression, I get the following system of equations:
    \frac{A_0}{x_0 ^2}+\frac{A_1}{x_1 ^2}=2
    \frac{A_0}{x_0}+\frac{A_1}{x_1}=0
    A_0+A_1=\frac{2}{3}
    x_0A_0+x_1A_1=0.
    If I understood well, I must solve for x_0, x_1, A_0 and A_1?
    The system is not even linear... Hmm. I probably went wrong somewhere. I would appreciate a tip on this one, thanks in advance.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor chisigma's Avatar
    Joined
    Mar 2009
    From
    near Piacenza (Italy)
    Posts
    2,162
    Thanks
    5
    The Gauss Legendre quadrature method...

    Legendre-Gauss Quadrature -- from Wolfram MathWorld

    ... compute a definite integral as...

    \int_{-1}^{1} f(x)\ dx \sim \sum_{i=1}^{n} a_{i}\ f(x_{i}) (1)

    ... and the result is exact if f(x) is a polynomial of degree r \le 2n-1. For n=2 x_{i} = \pm \sqrt{\frac{1}{3}} and a_{i}=1...

    Kind regards

    \chi \sigma
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor arbolis's Avatar
    Joined
    Apr 2008
    From
    Teyateyaneng
    Posts
    1,000
    Awards
    1
    Thanks chisigma, I appreciate your help. I looked into mathworld but didn't understand how you found that the formula is exact for a polynomial of degree lesser or equal than 2n-1. Nor do I know how you found out x_i and a_i.
    I've searched into wikipedia about Gaussian quadrature and they indeed find the same values. It seems I must dig into Legrendre's polynomials in order to understand what's going on.
    Also, I don't know what's wrong with my method. Could you tell me what did I do wrong?!
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by arbolis View Post
    Thanks chisigma, I appreciate your help. I looked into mathworld but didn't understand how you found that the formula is exact for a polynomial of degree lesser or equal than 2n-1.
    The error formula gives that the error is some multiple, depending only on n, times the value of the derivative of order 2n at some point in the interval. But the derivative of order 2n is identicaly zero for a polynomial of degree 2n-1 or less.

    CB
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by arbolis View Post
    The problem reads "I must calculate \int _{-1}^1 f(x)x^2 dx via a quadrature rule of the form \int _{-1}^1 f(x)x^2 dx ~A_0 f (x_0)+A_1 f(x_1) that is exact for polynomials with degree lesser or equal to 3."
    Attempt: Not much. I don't understand why use the "f(x)" in the expression. Does this mean that f(x) is a polynomial of degree lesser or equal to 1?

    The expression must be exact for polynomials up to degree 3. It's equivalent to say it must be exact for f(x)x^2= 1, x, x^2 and x^3. .
    Exact for f(x)=1, x, x^2, x^3 or f(x)x^2=x^2,x^3,x^4,x^5

    CB
    Follow Math Help Forum on Facebook and Google+

  6. #6
    MHF Contributor arbolis's Avatar
    Joined
    Apr 2008
    From
    Teyateyaneng
    Posts
    1,000
    Awards
    1

    Re: Numerical analysis, calculating an integral exactly for some polynomials

    Quote Originally Posted by CaptainBlack View Post
    Exact for f(x)=1, x, x^2, x^3 or f(x)x^2=x^2,x^3,x^4,x^5

    CB
    I have to say this even if late: Thank you very much.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. numerical analysis
    Posted in the Differential Equations Forum
    Replies: 1
    Last Post: November 7th 2009, 02:20 PM
  2. [SOLVED] Calculating an improper integral via complex analysis
    Posted in the Differential Geometry Forum
    Replies: 3
    Last Post: October 25th 2009, 11:33 AM
  3. Replies: 4
    Last Post: October 24th 2009, 02:08 PM
  4. Replies: 7
    Last Post: July 4th 2009, 02:22 PM
  5. Numerical Method for calculating Eigenvector?
    Posted in the Advanced Algebra Forum
    Replies: 8
    Last Post: May 15th 2008, 05:54 PM

Search Tags


/mathhelpforum @mathhelpforum