Fehlerfunktion

Plot[(1/(5!)) (∏_(k = -2)^2) Abs[
            x - k  (π/2)], {x, -π, π}]

f = (1/(5!)) (∏_(k = -2)^2)(x - 
              k  (π/2))

f // Expand

D[f, x] // Expand

sol = Solve[D[f, x] == 0, x]

sol // N

f /. sol // N

ableitung[x_] = D[f, x] // Expand

Newton-Verfahren

ϕ[x_] = Together[x - ableitung[x]/D[ableitung[x], x]]

FixedPoint[ϕ, 2. ]

FixedPoint[ϕ, 1. ]

Oszillation

daten = {{0, 0}, {4, 0.1}, {7, 0.3}, {8, 0.8}, {9, 2}, {10, 
          10}}

Lagrange[a_, 
        x_] := (∑_(k = 1)^(Length[a]))(a[[k, 2]]*
            Product[((x - a[[j, 1]])/(a[[k, 1]] - a[[j, 1]])), {j, 1, k - 1}]*
            Product[((x - a[[l, 1]])/(a[[k, 1]] - a[[l, 1]])), {l, k + 1, Length[a]}])

f = Lagrange [daten, x]

LagrangePlot[a_, x_] := 
      Module[{f, plot1, plot2}, f = Lagrange[a, x]; 
        plot1 = Plot[
            f, {x, Min[Transpose[daten][[1]]], 
              Max[Transpose[daten][[1]]]}, 
            DisplayFunction -> Identity]; 
plot2 = 
          Graphics[{PointSize[0.03], 
              Map[Point, daten]}]; 
Show[plot1, plot2, 
          DisplayFunction -> $DisplayFunction]
]

plot1 = LagrangePlot[daten, x]

Quadratische Splines

daten

QuadratischerSpline[daten_] := 
      Module[{x, y, n, a, b, k}, 
Do[
          x[k] = daten[[k + 1, 1]]; 
          y[k] = daten[[k + 1, 2]], {k, 0, 
            Length[daten] - 1}]; 
n = 
          Length[daten] - 1; 
a[
            0] = ((y[1] - y[0])/(x[1] - x[0])); 
Do[
          a[k] = -a[k - 1] + 
              2 (( y[k] - y[k - 1])/(x[k] - x[k - 1])), {k, 1, 
            n}]; 
Do[
          b[k] = ((a[k + 1] - a[k])/(2 (x[k + 1] - x[k]))), {k, 0, 
            n - 1}]; 
Table[{a[k], b[k]}, {k, 0, 
            n - 1}]
]

QuadratischerSpline[daten]

QuadratischerSplinePlot[daten_] := 
      Module[{ab, x, plot, plot2, k}, 
ab = 
          QuadratischerSpline[daten]; 
Do[
          plot[k] = 
            Plot[daten[[k, 2]] + 
                ab[[k, 1]] (x - daten[[k, 1]]) + 
                ab[[k, 2]] (((x - daten[[k, 1]]))^2), {x, 
                daten[[k, 1]], 
                daten[[k + 1, 
                    1]]}, 
DisplayFunction -> 
                Identity], {k, 
            Length[daten] - 1}]; 
plot2 = 
          Graphics[{PointSize[0.03], 
              Map[Point, daten]}]; 
Show[{Table[
              plot[k], {k, Length[daten] - 1}], plot2}, 
          DisplayFunction -> $DisplayFunction, 
          PlotRange -> All] 
]

QuadratischerSplinePlot[daten]

Kubische Splines

<< NumericalMath`SplineFit`

spline = SplineFit[daten, Cubic]

plot2 = 
      ParametricPlot[spline[k], {k, 0, 5}, PlotRange -> All, 
        Compiled -> False]

Show[plot1, plot2]