Question: Question about product/ mul functions [mul(function(j), j=1..n, j<>i) is what I need, the j<>i doesnt work though]


I am trying to determine the weights of a Gauß quadrature rule, the code I currently have is this:


for i from 1 to n do
  for j from 1 to n do
    if i <> j then
      RekursivesZwischenergebnis:= RekursivesZwischenergebnis*((x-GaußKnoten[j])/(GaußKnoten[i]-GaußKnoten[j]))
    end if;
  end do;
end do;

The code works, is inefficient however. I want to use the product or mul function, however I dont know how to tell Maple not to multiply


if j=i.  mul(function(j), j=1..n,j<>i) doesnt work. Any efficient suggestions?

Please Wait...