Con la ayuda de las variables de holgura ϵi y llamadas
L(p,μϵ,λ)=p1p2p3p4p5+μ5(p1−p2−ϵ25)+μdimm4(p2−p3−ϵdimm24)+μ3(p3−p4−ϵ23)+μ2(p4−p5−ϵ22)+μ1(p5−ϵ21)+λ(p1x1+p2(x2−x1)+p3(x3−x2)+p4(x4−x3)+p5(x5−x4)−1)
and solving the sationary conditions
∇L=0
we obtain a set of solutions jointly with a set of conditions ϵ2i≥0 to qualify those solutions. To be feasible the solution requires that ϵ2i≥0 Also when ϵ2i=0 it means that the corresponding restriction is active.
Due to the length of the symbolic response, we leave a script in MATHEMATICA that summarizes the results. There are sixteen non trivial solutions in res0 with structure {pi,ϵ2i,p1p2p3p4p5}
n = 5;
X = Table[Subscript[x, k], {k, 1, n}];
P = Table[Subscript[p, k], {k, 1, n}];
EE = Table[Subscript[epsilon, k], {k, 1, n}];
M = Table[Subscript[mu, k], {k, 1, n}];
vars = Join[Join[Join[P, M], EE], {lambda}]
prod = Product[P[[k]], {k, 1, n}]
L = prod
L += lambda (Sum[P[[k]] (X[[k]] - X[[k - 1]]), {k, 2, n}] + P[[1]] X[[1]] - 1)
L += Sum[M[[k]] (P[[n - k + 1]] - P[[n - k + 2]] + EE[[k]]^2), {k, 2, n}] + M[[1]] (P[[n]] - EE[[1]]^2)
grad = Grad[L, vars]
equs = Thread[grad == 0];
E2 = EE^2;
results = Join[Join[P, E2], {prod}];
sols = Quiet[Solve[equs, vars]];
results0 = results /. sols // FullSimplify;
For[i = 1; res = {}, i <= Length[results0], i++,
If[NumberQ[results0[[i]][[2 n + 1]]] == False, AppendTo[res,results0[[i]]]]
]
res0 = Union[res];
res0 // MatrixForm
Results for n=3
[p1p2p3ϵ21ϵ22ϵ23p1p2p313x113(x2−x1)13(x3−x2)13(x3−x2)13x2−3x3+13(x2−x1)13(1x1−x2+1x1)127(x21−x1x2)(x2−x3)13x123(x3−x1)23(x3−x1)23(x3−x1)013(2x1−x3+1x1)427x1(x1−x3)223x223x213(x3−x2)13(x3−x2)13x2−3x3+23x20427x22(x3−x2)1x31x31x31x3001x33]
Results for n=4
[p1p2p3p4ϵ21ϵ22ϵ23ϵ24p1p2p3p414x114(x2−x1)14(x3−x2)14(x4−x3)14(x4−x3)14x3−4x4+14(x3−x2)14x2−4x3+14(x2−x1)14(1x1−x2+1x1)−1256(x21−x1x2)(x2−x3)(x3−x4)14x114(x2−x1)12(x4−x2)12(x4−x2)12(x4−x2)012x2−2x4+14(x2−x1)14(1x1−x2+1x1)−164x1(x1−x2)(x2−x4)214x112(x3−x1)12(x3−x1)14(x4−x3)14(x4−x3)14x3−4x4+12(x3−x1)014(2x1−x3+1x1)164x1(x1−x3)2(x4−x3)14x134(x4−x1)34(x4−x1)34(x4−x1)34(x4−x1)0014(3x1−x4+1x1)27256x1(x4−x1)312x212x214(x3−x2)14(x4−x3)14(x4−x3)14x3−4x4+14(x3−x2)14x2−4x3+12x20164x22(x2−x3)(x3−x4)12x212x212(x4−x2)12(x4−x2)12(x4−x2)012(1x2−x4+1x2)0116x22(x2−x4)234x334x334x314(x4−x3)14(x4−x3)14x3−4x4+34x30027256x33(x4−x3)1x41x41x41x41x40001x44]
and for n=5
[p1p2p3p4p5ϵ21ϵ22ϵ23ϵ24ϵ25p1p2p3p4p515x1−15(x1−x2)−15(x2−x3)−15(x3−x4)−15(x4−x5)−15(x4−x5)x3−2x4+x55(x3−x4)(x4−x5)x2−2x3+x45(x2−x3)(x3−x4)x1−2x2+x35(x1−x2)(x2−x3)2x1−x25x1(x1−x2)13125x1(x1−x2)(x2−x3)(x3−x4)(x4−x5)15x1−15(x1−x2)−15(x2−x3)−25(x3−x5)−25(x3−x5)−25(x3−x5)02x2−3x3+x55(x2−x3)(x3−x5)x1−2x2+x35(x1−x2)(x2−x3)2x1−x25x1(x1−x2)43125x1(x1−x2)(x2−x3)(x3−x5)215x1−15(x1−x2)−25(x2−x4)−25(x2−x4)−15(x4−x5)−15(x4−x5)x2−3x4+2x55(x2−x4)(x4−x5)02x1−3x2+x45(x1−x2)(x2−x4)2x1−x25x1(x1−x2)43125x1(x1−x2)(x2−x4)2(x4−x5)15x1−15(x1−x2)−35(x2−x5)−35(x2−x5)−35(x2−x5)−35(x2−x5)003x1−4x2+x55(x1−x2)(x2−x5)2x1−x25x1(x1−x2)273125x1(x1−x2)(x2−x5)315x1−25(x1−x3)−25(x1−x3)−15(x3−x4)−15(x4−x5)−15(x4−x5)x3−2x4+x55(x3−x4)(x4−x5)x1−3x3+2x45(x1−x3)(x3−x4)03x1−x35x1(x1−x3)43125x1(x1−x3)2(x3−x4)(x4−x5)15x1−25(x1−x3)−25(x1−x3)−25(x3−x5)−25(x3−x5)−25(x3−x5)02(x1−2x3+x5)5(x1−x3)(x3−x5)03x1−x35x1(x1−x3)163125x1(x1−x3)2(x3−x5)215x1−35(x1−x4)−35(x1−x4)−35(x1−x4)−15(x4−x5)−15(x4−x5)x1−4x4+3x55(x1−x4)(x4−x5)004x1−x45x1(x1−x4)273125x1(x1−x4)3(x4−x5)15x1−45(x1−x5)−45(x1−x5)−45(x1−x5)−45(x1−x5)−45(x1−x5)0005x1−x55x1(x1−x5)2563125x1(x1−x5)425x225x2−15(x2−x3)−15(x3−x4)−15(x4−x5)−15(x4−x5)x3−2x4+x55(x3−x4)(x4−x5)x2−2x3+x45(x2−x3)(x3−x4)3x2−2x35x2(x2−x3)0−43125x22(x2−x3)(x3−x4)(x4−x5)25x225x2−15(x2−x3)−25(x3−x5)−25(x3−x5)−25(x3−x5)02x2−3x3+x55(x2−x3)(x3−x5)3x2−2x35x2(x2−x3)0−163125x22(x2−x3)(x3−x5)225x225x2−25(x2−x4)−25(x2−x4)−15(x4−x5)−15(x4−x5)x2−3x4+2x55(x2−x4)(x4−x5)02(2x2−x4)5x2(x2−x4)0−163125x22(x2−x4)2(x4−x5)25x225x2−35(x2−x5)−35(x2−x5)−35(x2−x5)−35(x2−x5)005x2−2x55x2(x2−x5)0−1083125x22(x2−x5)335x335x335x3−15(x3−x4)−15(x4−x5)−15(x4−x5)x3−2x4+x55(x3−x4)(x4−x5)4x3−3x45x3(x3−x4)00273125x33(x3−x4)(x4−x5)35x335x335x3−25(x3−x5)−25(x3−x5)−25(x3−x5)05x3−3x55x3(x3−x5)001083125x33(x3−x5)245x445x445x445x4−15(x4−x5)−15(x4−x5)5x4−4x55x4(x4−x5)000−2563125x44(x4−x5)1x51x51x51x51x51x500001x55]