# Find The Value of a n-order Determinant

In Mathematica, we can find the value of a determinant with the built-in function Det. But how can I find the value of a determinant like this one?

$$\left|\begin{array}{ccccc}1 & x & x^{2} & \cdots & x^{n-1} \\ 1 & a_{1} & a_{1}^{2} & \cdots & a_{1}^{n-1} \\ \vdots & \vdots & \vdots & & \vdots \\ 1 & a_{n-1} & a_{n-1}^{2} & \cdots & a_{n-1}^{n-1}\end{array}\right|$$

• What is the question? Documentation for Det can be found here. Oct 5, 2020 at 8:49
• This is a Vandermonde determinant. Oct 6, 2020 at 10:14
• Also asked and answered on Wolfram Community. Oct 6, 2020 at 13:59
• Code-golfed answer Oct 7, 2020 at 17:48

Making use of the observation that the OP is asking for a Vandermonde determinant:

With[{n = 5},
Product[a[i]-a[j], {i, 0, n - 1}, {j, 0, i - 1}] /. a[0] -> x]

(*    (-x+a[1])(-x+a[2])(-a[1]+a[2])(-x+a[3])(-a[1]+a[3])(-a[2]+a[3])(-x+a[4])(-a[1]+a[4])(-a[2]+a[4])(-a[3]+a[4])    *)


This method is exponentially faster than actually building the matrix and calculating its determinant. Also, it is numerically more stable.

Clear["*"];
n = 5;
v = Table[Subscript[a, i], {i, 0, n - 1}] /. Subscript[a, 0] -> x
m = Outer[Power, v, Range[0, n - 1]];
m // MatrixForm
m // Det // Simplify


Why should this not work? Maybe you have some syntax error? Here is an example:

n = 3;
(da = Transpose@
Table[Prepend[Array[Subscript[a, #] &, n - 1], x]^i, {i, 0,
n - 1}]) // MatrixForm
Det[da]
`