# Apéndice. Álgebra lineal con wxMaxima
4. Determinante de una matriz cuadrada

## Determinante de una matriz cuadrada: definición

kill(all)$

'A2=A2:matrix([a11,a12],[a21,a22]);     detA2=determinant(A2);      
det(A2)=determinant(A2);

'A3=A3:matrix([a11,a12,a13],[a21,a22,a23],[a31,a32,a33]);    detA3=determinant(A3);    expand(%);

'B3=B3:matrix([a11,a12,a13],[0,a22,a23],[0,0,a33]);
detB3=determinant(B3);

'B4=B4:matrix([a11,a12,a13,a14],[0,a22,a23,a24],[0,0,a33,a34], [0,0,0,a44]  );        
detB4=determinant(B4);

## Cálculo del determinante de una matriz

kill(all)$

'C1=C1: matrix(   [1.01,2.02,0.99,0.01,0.01],     
                        [1.02,1.01,-1.01,2.02,0.01],    
                        [1.99,2.99,0.01,1.01,0.02], 
                        [-1.01,0.02,1.02,-2.01,0.03],   
                        [0.24, -0.972, 1.23, -1.954, 1.36]   );

detC1=determinant(C1);

## Cálculo de la matriz inversa aplicando determinantes

kill(all)$

'M1=M1: matrix(  [1,2,1,0],      [1,1,-1,2],     [2,3,0,1],      [-1,0,1,-2] );

detM1=detM1:determinant(M1);

adjM1=adjM1:adjoint(M1);

inv_M1=invM1:(1/detM1)*adjM1;

M1.invM1;