Results 1 to 7 of 7
Like Tree2Thanks
  • 1 Post By romsek
  • 1 Post By JeffM

Math Help - Find the Riemann sum

  1. #1
    Newbie
    Joined
    Jul 2014
    From
    Macedonia
    Posts
    21
    Thanks
    1

    Find the Riemann sum

    Determinate the Riemann sum: SUM[ f(Xk)deltaXk ] where k=1 to n if f(x)=x^2-x-2 for x E [-2,2] and n=4. The partition is regular and we should use the left end point of the subintervals.

    Now i got Deltaxk=1 ; Xk=k-3 ; f(Xk)= k^2 - 7k + 10 ; And the final result i have is 60 .

    I want to know should i have the same result if i`m solving the definite integral Integral of: (x^2-x-2)dx where a=-2; b=2 ; as the riemann sum result , which doesnt happens.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Nov 2013
    From
    California
    Posts
    2,789
    Thanks
    1149

    Re: Find the Riemann sum

    If I understand your question you have

    $f(x)=x^2-x-2$

    and you want to find the Riemann Sum approximation of

    $\displaystyle{\int_{-2}^{2}}f(x)~dx$

    With $n=4$ It should be pretty clear that your left endpoints will be $-2, -1, 0, 1$, and that $\Delta x=1$

    This matches with what you found.

    So your Riemann sum is

    $f(-2)+f(-1)+f(0)+f(1) = 4+0-2-2=0$

    how you got 60 out of this I don't know.

    The actual definite integral above is equal to $-\dfrac 8 3$.

    The Riemann Sum is just an approximation. If you let n=8 you find the Riemann Sum equals $-\dfrac 3 2$, i.e.

    the approximation improves with increasing $n$ as is expected.
    Thanks from MirceM
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Super Member
    Joined
    Feb 2014
    From
    United States
    Posts
    825
    Thanks
    418

    Re: Find the Riemann sum

    Quote Originally Posted by MirceM View Post
    Determinate the Riemann sum: SUM[ f(Xk)deltaXk ] where k=1 to n if f(x)=x^2-x-2 for x E [-2,2] and n=4. The partition is regular and we should use the left end point of the subintervals.

    Now i got Deltaxk=1 ; Xk=k-3 ; f(Xk)= k^2 - 7k + 10 ; And the final result i have is 60 .

    I want to know should i have the same result if i`m solving the definite integral Integral of: (x^2-x-2)dx where a=-2; b=2 ; as the riemann sum result , which doesnt happens.
    In general, a Riemann sum will not equal the corresponding definite integral. What will equal the corresponding definite integral is the limit of the Riemann sum as the number of partitions approaches infinity.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Jul 2014
    From
    Macedonia
    Posts
    21
    Thanks
    1

    Re: Find the Riemann sum

    @romsek Right , the definite integral is -8/3 . Now how i got 60 from the sum:
    by the formula i have f(Xk)=(k^2-7k+10) , cause Xk=k-3 , than in the SUM[ f(Xk)deltaXk ] where k=1 to n , i`m replacing f(Xk)deltaXk and so i got the SUM [(k^2 -7k+10)*1] where k=1 to n , solving this and replacing n=4 i got the result 60.

    I think JeffM is right , it actually has sense , the reason i dont get the same result is that in the sum i have only 4 parts of a function.. but what bothers me is that if i write n->+inf i cant solve the sum than.. i got undefined answer +inf-inf.

    This after all tells me that i`m making some mistake in the Riemann sum solving process..

    Note: i`m solving this with Sigma notation, i will explain how i got the results once again to be more clear:
    Xk=a+(k-1)DeltaXk= -2+(k-1)*1=k-3=Xk
    replacing Xk in f(x) so i could get f(Xk) will give me f(Xk)= (k-3)^2-(k-3)-2=k^2-6k+9-k+3-2=k^2-7k+10=f(Xk)
    from that i have 3 separate sums like: SUM[k^2]-7SUM[k]+SUM[10] where k=1 to n;
    evaluating all of them gives me: [n(n+1)(2n+1)]/2 -[7n(n+1)]/2 +40 ; replacing for n=4 , sum=60..
    Last edited by MirceM; August 15th 2014 at 08:26 AM.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Super Member
    Joined
    Feb 2014
    From
    United States
    Posts
    825
    Thanks
    418

    Re: Find the Riemann sum

    Let's establish the general formula for the left-hand Riemann Sum of f(x) from a to b.

    $\displaystyle \sum_{i = 0}^{n - 1}\left\{h * f \left(a + ih\right)\right\}, where\ h = \dfrac{b - a}{n}.$

    If n is small that is all you need.

    $f(x) = x^2 - x - 2\ and\ n = 4\ and\ a = -2\ and\ b = +2 \implies h = \dfrac{2 - (-2)}{4} = 1 \implies\displaystyle \sum_{i = 0}^{n - 1}\left\{h * f \left(a + ih\right)\right\} = \sum_{i = 0}^{4 - 1}\left\{1 * f \left(-2 + i * 1\right)\right\} =$

    $\displaystyle \sum_{i = 0}^3f \left(-2 + i\right) = f(-2 + 0) + f(-2 + 1) + f(- 2 + 2) + f(-2 + 3) = f(-2) + f(-1) + f(0) + f(1) =$

    $\{(-2)^2 - (-2) - 2\} + \{(-1)^2 - (-1) - 2\} + (0^2 - 0 - 2) + (1^2 - 1 - 2) = (4 + 2 - 2) + (1 + 1 - 2) - 2 + (1 - 1 - 2) =$

    $4 + 0 - 2 - 2 = 0 \ne 60.$

    If n is large, however, things are not quite so simple. More generally,

    $f(x) = x^2 - x - 2\ and\ a = -2\ and\ b = +2 \implies h = \dfrac{2 - (-2)}{n} = \dfrac{4}{n} \implies$

    $\displaystyle \sum_{i = 0}^{n - 1}\left\{h * f\left(a + ih\right)\right\} = \sum_{i = 0}^{n - 1}\left\{\dfrac{4}{n} * f \left(-2 + \dfrac{4i}{n}\right)\right\} = \sum_{i = 0}^{n - 1}\left\{\dfrac{4}{n} * f \left(\dfrac{-2n + 4i}{n}\right)\right\} =$

    $\displaystyle \sum_{i = 0}^{n - 1}\dfrac{4}{n}\left\{\left(\dfrac{-2n + 4i}{n}\right)^2 - \dfrac{-2n + 4i}{n} - 2\right\} = \sum_{i = 0}^{n - 1}\left(\dfrac{4(4n^2 - 16in + 16i^2)}{n^3} - \dfrac{4n(-2n + 4i)}{n^3} - \dfrac{4n^2 * 2}{n^3}\right) =$

    $\displaystyle \sum_{i = 0}^{n - 1}\left(\dfrac{16n^2 - 64in + 64i^2 + 8n^2 - 16in - 8n^2}{n^3}\right) = \sum_{i = 0}^{n - 1}\left(\dfrac{16n^2 - 80in + 64i^2}{n^3}\right) =$

    $\left\{\dfrac{16}{n} * \displaystyle \sum_{i = 0}^{n - 1}1\right\} - \left\{\dfrac{80}{n^2} * \displaystyle \sum_{i = 0}^{n - 1}i\right\} + \left\{\dfrac{64}{n^3} * \displaystyle \sum_{i = 0}^{n - 1}i^2\right\} = \left(\dfrac{16}{n} * n\right) - \left(\dfrac{80}{n^2} * \dfrac{(n - 1)n}{2}\right) + \left(\dfrac{64}{n^3} * \dfrac{(n - 1)(n)(2n - 1)}{6}\right) = $

    $16 - \dfrac{40n^2 - 40n}{2n^2} + \dfrac{64(2n^3 - 3n^2 + n)}{6n^3} = 16 - 40 + \dfrac{40n}{n^2} + \dfrac{128n^3 - 192n^2 + 64n}{6n^3} =$

    $\displaystyle -24 + \dfrac{240n^2}{6n^3} + \dfrac{128n^3 - 192n^2 + 64n}{6n^3} = -24 + \dfrac{128}{6} + \dfrac{48n^2 + 64n}{6n^3} = \dfrac{-8}{3} + \dfrac{24n + 32}{3n^2}.$

    Now that is some VERY ugly algebra. Disgusting in fact. We had better test it.

    $n = 4 \implies \dfrac{-8}{3} + \dfrac{24n + 32}{3n^2} = \dfrac{-8}{3} + \dfrac{24 * 4 + 32}{3 * 4^2} = \dfrac{-128}{48} + \dfrac{128}{48} = 0.$

    Well we know that is correct so maybe for once I did my algebra correctly.

    Now let's take the limit

    $\displaystyle \lim_{n \rightarrow \infty}\left(\dfrac{-8}{3} + \dfrac{24n + 32}{3n^2}\right) = \lim_{n \rightarrow \infty}\dfrac{-8}{3} + \lim_{n \rightarrow \infty}\dfrac{8}{n} + \lim_{n \rightarrow \infty}\dfrac{32}{3n^2} = \dfrac{-8}{3} + 0 + 0 = \dfrac{-8}{3}.$

    And $\displaystyle \int_{-2}^2 (x^2 - x - 2)\ dx = \left(\dfrac{2^3}{3} - \dfrac{2^2}{2} - 2 * 2\right) -\left(\dfrac{(-2)^3}{3} - \dfrac{(-2)^2}{2} - 2 * (-2)\right) =$

    $\dfrac{8}{3} - \dfrac{4}{2} - 4 - \dfrac{-8}{3}\ + \dfrac{4}{2} - 4 = -8 + \dfrac{2 * 8}{3} = \dfrac{-3 * 8}{3} + \dfrac{2 * 8}{3} = \dfrac{-8}{3}.$

    $\therefore \displaystyle \lim_{n \rightarrow \infty}\left(\dfrac{-8}{3} + \dfrac{24n + 32}{3n^2}\right) = \dfrac{-8}{3} = \int_{-2}^2 (x^2 - x - 2)\ dx.$
    Last edited by JeffM; August 16th 2014 at 01:12 PM.
    Thanks from MirceM
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Jul 2014
    From
    Macedonia
    Posts
    21
    Thanks
    1

    Re: Find the Riemann sum

    Oh my god.. now i see my stupid and banal mistake.. Right the result is 0 , i wrote down the formula for SUM[k^2] from k=1 to n wrong , [(n+1)(2n+1)]/2 instead of [(n+1)(2n+1)]/6..
    I`m so sorry for bothering you and wasted your time..

    [SOLVED]
    Last edited by MirceM; August 17th 2014 at 01:20 PM.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Super Member
    Joined
    Feb 2014
    From
    United States
    Posts
    825
    Thanks
    418

    Re: Find the Riemann sum

    Not a waste of time: it is what we are here for.

    However, Riemann Sums frequently do involve ugly algebra. I recommend always testing any general formula you get for the sum by working out the result with a small number for n, generally n = 3 or n = 4. That is, we could test the general formula above by working out the values for f(-2), f(-1), f(0), and f(1). That won't tell you where any error is in your algebra, but it does give you a very good indicator whether or not there is an error. Actually, I made an error in my first go round; it took me quite a while to find it.

    Thanks for the thanks.
    Last edited by JeffM; August 17th 2014 at 02:01 PM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Using Riemann Sums To Find Area
    Posted in the Calculus Forum
    Replies: 2
    Last Post: May 15th 2012, 07:41 AM
  2. Replies: 1
    Last Post: January 16th 2010, 03:31 AM
  3. Find the Riemann sum
    Posted in the Calculus Forum
    Replies: 1
    Last Post: August 31st 2007, 01:55 PM
  4. Replies: 6
    Last Post: August 4th 2007, 10:48 AM
  5. Riemann Sums and Riemann Integrals
    Posted in the Calculus Forum
    Replies: 1
    Last Post: October 1st 2006, 02:08 PM

Search Tags


/mathhelpforum @mathhelpforum