3
$\begingroup$

This expression:

Det[Array[a, {3, 3}]]

is evaluated as:

$-a(1,3) a(2,2) a(3,1)+a(1,2) a(2,3) a(3,1)+a(1,3) a(2,1) a(3,2)-a(1,1) a(2,3)a(3,2)-a(1,2) a(2,1) a(3,3)+a(1,1) a(2,2) a(3,3)$

If I HoldForm it:

HoldForm[Det[Array[a, {3, 3}]]

Neither Det or Array is evaluated:

$| \text{Array}[a,\{3,3\}]|$

However, is it possible to hold Det only, so that it prints:

$\text{Det}\left( \begin{array}{ccc} a(1,1) & a(1,2) & a(1,3) \\ a(2,1) & a(2,2) & a(2,3) \\ a(3,1) & a(3,2) & a(3,3) \\ \end{array} \right)$

?

$\endgroup$
1
  • $\begingroup$ I think Inactivate would give you the fine grain control you seek. You can inactivate one head specifically, e.g. Det, while leaving everything else as it normally would be. $\endgroup$
    – MarcoB
    Dec 28, 2021 at 14:53

3 Answers 3

6
$\begingroup$

In addition to the solutions of Nasser and Syed you could inactivate the Det function like this:

array = Array[a, {3, 3}];

Inactive[Det][array]

enter image description here

If you want it in the matrix form, you can do it either like in the answer of Nasser, or like this:

MapAt[MatrixForm, Inactive[Det][array], {1}] 

enter image description here

In the both cases, Det will be shown blended.

Have fun!

$\endgroup$
4
$\begingroup$

However, is it possible to hold Det only, so that it prints:

$$ \text{Det}\left( \begin{array}{ccc} a(1,1) & a(1,2) & a(1,3) \\ a(2,1) & a(2,2) & a(2,3) \\ a(3,1) & a(3,2) & a(3,3) \\ \end{array} \right) $$

I am not sure if you mean you want Latex output, or Mathematica output for display only.

If you mean Mathematica output for display use only, then you can take advantage that MatrixForm is a wrapper which prevents evaluation. So you can

ClearAll[a]
array = Array[a, {3, 3}]
Det[MatrixForm[array]]

Mathematica graphics

You can not use the above for computation, since MatrixForm is inside.

If you want later to use normal array, you can do

Det[array]
$\endgroup$
2
  • $\begingroup$ It should read: "You can NOT use the above for computation, since MatrixForm is inside." $\endgroup$ Dec 28, 2021 at 8:50
  • $\begingroup$ @DanielHuber. Thanks. typo fixed. $\endgroup$
    – Nasser
    Dec 28, 2021 at 8:52
3
$\begingroup$

For display purposes only:

arr = Array[a, {3, 3}]
arrT = arr // TraditionalForm

RowBox[{"Det", arrT, "=", TraditionalForm@Det[arr]}] // DisplayForm

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.