Numerische Integration

Fehlerabschätzung mit Restglied: n=1

Plot[-(x - 1) (x + 1), {x, -1, 1}]

fehler = (∫_a^b)-(x - a) (x - 
                b) \[DifferentialD]x // Factor

n=2

Plot[(x - 1) x (x + 1), {x, -1, 1}]

fehler = 
      2 (∫_a^(((a + b)/2)))(x - 
                  a) (x - ((a + b)/2)) (x - 
                  b) \[DifferentialD]x // Factor

Nochmals Simpson:

Solve[{b - a == A [1] + A[2] + A[3], 
        ((b^2)/2) - ((a^2)/2) == A [1] a + A[2] ((a + b)/2) + A[3] b, 
        ((b^3)/3) - ((a^3)/3) == 
          A [1] (a^2) + A[2] (((((a + b)/2)))^2) + A[3] (b^2)}, {A[1], A[2], 
        A[3]}]

Summierte Trapezregel

Trapezregel[f_, {x_, a_, b_}, 
        n_] := ((b - a)/(2  
                n)) ((f /. x -> a) + (f /. 
                  x -> b)) + ((b - 
                a)/n) (∑_(k = 1)^(n - 1))(f /. 
                x -> a + k (( b - a)/n))

(∫_0^1)(Sqrt[ 1 - (x^2)]) \[DifferentialD]x

N[%]

int = 
      Table[Trapezregel[(Sqrt[1 - (x^2)]), {x, 0, 1}, (2^k)], {k, 1, 
          3}]

int = 
      Table[N[Trapezregel[(Sqrt[1 - (x^2)]), {x, 0, 1}, (2^k)]], {k, 1, 
          10}]

Summierte Simpsonregel

Simpsonregel[f_, {x_, a_, b_}, 
        n_] := ((b - a)/(3  
                n)) ((f /. x -> a) + (f /. 
                  x -> b)) + ((b - a)/(3  
                n)) (∑_(k = 1)^(n - 1))If[EvenQ[k], 2, 
                4] (f /. x -> a + k (( b - a)/n))

N[(∫_0^1)(Sqrt[ 1 - (x^2)]) \[DifferentialD]x]

int = 
      Table[N[Simpsonregel[(Sqrt[1 - (x^2)]), {x, 0, 1}, (2^k)]], {k, 1, 
          10}]