Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Integrating a product of two functions - one lags the other

  1. Aug 15, 2013 #1
    Integrating a product of two functions - one "lags" the other

    I am wondering if there is a way to integrate the following function without first expanding the brackets:

    [itex]\int\limits_{x1}^{x2} x^2\left(x-a\right)^2\,dx[/itex]

    The idea behind the question is a bit more complex than I am letting on, but this example gets to the heart of the problem.


    For the interested reader I will give a bit more background; I am really trying to do the following integral:

    [itex]\int\limits_{x1}^{x2} Bx_{k1}^{n1}(tx1(x))Bx_{k2}^{n2}(tx2(x))\,dx[/itex]

    where the functions tx1 and tx2 return values ranging from [0,1] over the domain to be integrated. Actually, I can just tell you what they are.

    [itex]tx1=\frac{250x}{21}-\frac{5}{7}[/itex] and [itex]tx2=\frac{250x}{21}[/itex] while [itex]x_1=0.06[/itex] and [itex]x_2=0.084[/itex]

    The Bx functions are Bernstein basis polynomials. In the above example, I have used the "square" function instead.

    Note that I can solve this problem by converting the Bernstein polynomials to the power basis (this is akin to expanding the brackets in the original question). However, I am trying to avoid doing this for reasons of numerical stability and efficiency.
  2. jcsd
  3. Aug 15, 2013 #2
    I just had a thought... it seems to me that a nested integration by parts might work. The idea came to me by looking at the "simple" but representative example above. This should also work for Bernstein polynomials, as their derivatives eventually become zero, in a similar fashion to the monomials.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook