Using MathCAD's iterated product to calculate Lagrange-like terms≔x1234⎡⎢⎢⎢⎣⎤⎥⎥⎥⎦≔n 4=∏=j 0−n 1xj24≔L((i))⋅∏=j 0−i 1xj∏=j +i 1−n 1xj=L((0))? =L((1))12 =L((2))8=L((3))?≔L((i))‖‖‖‖‖‖‖‖‖‖‖‖‖‖‖|||||||||||||||||||||||||||ifelse ifelse=i 0‖‖‖‖∏=j 1−n 1xj=i −n 1‖‖‖‖∏=j 0−i 1xj‖‖‖‖⎛⎜⎝⋅∏=j 0−i 1xj∏=j +i 1−n 1xj⎞⎟⎠=L((0))24 =L((1))12 =L((2))8=L((3))6Non-Commercial Use OnlyAlternative:≔L((i))‖‖‖‖‖‖‖‖‖‖‖‖‖‖‖‖||||||||||||||||||||||||||||ifelse ifelse=i 0‖‖‖‖←L ∏=j 1−n 1xj=i −n 1‖‖‖‖←L ∏=j 0−i 1xj‖‖‖‖←L ⋅∏=j 0−i 1xj∏=j +i 1−n 1xjreturn L=L((0))24 =L((1))12 =L((2))8=L((3))6Non-Commercial Use
View Full Document