# [Maxima] simplification to a determinant

Barton Willis willisb at unk.edu
Mon Jul 21 06:30:20 CDT 2008

```(%i18) m : matrix([dx,dy,dz],[s1x, s1y, s1z],[s2x, s2y, s2z])\$

(%i19) n : matrix([s4x,s4y,s4z],[s5x,s5y,s5z],[s6x, s6y, s6z])\$

(%i20) (dx *(dx *s1y *s2z - dy * s1x * s2z - dx * s1z *s2y + dz * s1x * s2y
+ dy *s1z * s2x - dz * s1y * s2x) *(s4x * s5y * s6z - s4y *s5x *s6z - s4x
* s5z * s6y
+ s4z *s5x* s6y + s4y *s5z *s6x - s4z *s5y *s6x))\$

(%i21) ratsubst('(det(m)), determinant(m),%)\$

(%i22) ratsubst('(det(n)), determinant(n),%);
(%o22) dx*det(m)*det(n)

Barton

>I'd like to know if exist some way to "teach" maxima to recognize that
>some terms in an expresion form a matrix determinant, e.g. that the
>expresion:
>
>([dx (dx s1y s2z - dy s1x s2z - dx s1z s2y + dz s1x s2y
>
> + dy s1z s2x - dz s1y s2x) (s4x s5y s6z - s4y s5x s6z - s4x s5z s6y
> + s4z s5x s6y + s4y s5z s6x - s4z s5y s6x)])
>
>is
>
>dx (determinant(M))(determinant(N))
>
>where M is matrix:
>
>dx   dy   dz
>
>s1x s1y s1z
>s2x s2y s2z
>
>and N is the matrix
>
>s4x s4y s4z
>s5x s5y s5z
>
>s6x s6y s6z
```