Search code examples
wolfram-mathematicamathematica-8

Calculating area of a function using Riemann's Sum


f[x_] := 2/(2x+2)
Limit[
    Sum[
        deltaX = 1/n;
        xk = 0 + k * deltaX; 
        f[xk]*deltaX, 
        {k, 1, n}
    ],
    n-> \[Infinity]
]

I have the following code however, It doesn't work. The error: $RecursionLimit::reclim: Recursion depth of 256 exceeded

The function is defined on the interval [0, 1]


Solution

  • Worked fine. Perhaps you had set variables in memory.

    enter image description here