The associated coefficients for a k-th degree polynomial to fit through {{xi-1,0},{xi,1},{xi+1,0}}
can be found through Solve
(better for k=2
) and Reduce
(for k=3
and k=4
). While I'm I don't understand the desire for doing this for k=3
and k=4
, I certainly wouldn't recommend do this for k > 4
.
(* Quadratic *)
Solve[{a[0] + a[1] xi + a[2] xi^2 == 1,
a[0] + a[1] (xi - 1) + a[2] (xi - 1)^2 == 0,
a[0] + a[1] (xi + 1) + a[2] (xi + 1)^2 == 0},
{a[0], a[1], a[2]}]
(* {{a[0] -> 1-xi^2,a[1] -> 2 xi,a[2] -> -1}} *)
(* Cubic *)
Reduce[{a[0] + a[1] xi + a[2] xi^2 + a[3] xi^3 == 1,
a[0] + a[1] (xi - 1) + a[2] (xi - 1)^2 + a[3] (xi - 1)^3 == 0,
a[0] + a[1] (xi + 1) + a[2] (xi + 1)^2 + a[3] (xi + 1)^3 == 0},
{a[0], a[1], a[2], a[3]}]
(* Quartic *)
k = 4
Reduce[{Sum[a[i] xi^i, {i, 0, k}] == 1,
Sum[a[i] (xi - 1)^i, {i, 0, k}] == 0,
Sum[a[i] (xi + 1)^i, {i, 0, k}] == 0}, Table[a[i], {i, 0, k}]]
InterpolatingPolynomial[]
. $\endgroup$