%mathpiper,def="WronskianMatrix"

// The arguments of the following functions should be checked
// this takes N funcs in 1 var
WronskianMatrix(f,v):=GenMatrix({{i,j}, Deriv(v,i-1) f[j]}, Length(f), Length(f) );

%/mathpiper



%mathpiper_docs,name="WronskianMatrix",categories="User Functions;Matrices (Special)"
*CMD WronskianMatrix --- create the Wronskian matrix
*STD
*CALL
	WronskianMatrix(func,var)
*PARMS

{func} -- an $n$-dimensional vector of functions

{var} -- a variable to differentiate with respect to

*DESC

The function {WronskianMatrix} calculates the Wronskian matrix
of $n$ functions.

The Wronskian matrix is created by putting each function as the
first element of each column, and filling in the rest of each
column by the ($i-1$)-th derivative, where $i$ is the current row.

The Wronskian matrix is used to verify that the $n$ functions are linearly
independent, usually solutions to a differential equation.
If the determinant of the Wronskian matrix is zero, then the functions
are dependent, otherwise they are independent.

*E.G.
In> WronskianMatrix({Sin(x),Cos(x),x^4},x);
Result: {{Sin(x),Cos(x),x^4},{Cos(x),-Sin(x),4*x^3},
	  {-Sin(x),-Cos(x),12*x^2}};
In> PrettyForm(%)

	/                                                 \
	| ( Sin( x ) )      ( Cos( x ) )      /  4 \      |
	|                                     \ x  /      |
	|                                                 |
	| ( Cos( x ) )      ( -( Sin( x ) ) ) /      3 \  |
	|                                     \ 4 * x  /  |
	|                                                 |
	| ( -( Sin( x ) ) ) ( -( Cos( x ) ) ) /       2 \ |
	|                                     \ 12 * x  / |
	\                                                 /
The last element is a linear combination of the first two, so the determinant is zero:
In> A:=Determinant( WronskianMatrix( {x^4,x^3,2*x^4 
	  + 3*x^3},x ) )
Result: x^4*3*x^2*(24*x^2+18*x)-x^4*(8*x^3+9*x^2)*6*x
	  +(2*x^4+3*x^3)*4*x^3*6*x-4*x^6*(24*x^2+18*x)+x^3
	  *(8*x^3+9*x^2)*12*x^2-(2*x^4+3*x^3)*3*x^2*12*x^2;
In> Simplify(A)
Result: 0;
%/mathpiper_docs