1
$\begingroup$

I have a symbolic matrix A, which I need to find the characteristic polynomial, then order the polynomial in greatest-to-least form. (Ultimately to find the matrix inversion via Cayley-Hamilton method).

Orders from least-to-greatest:

ClearAll["Global`*"]

(* Input Matrix *)
A = {{a, b}, {c, d}}

cp = Collect[CharacteristicPolynomial[A, x], x]
cl = CoefficientList[cp, x]

Using TraditionalForm[ ] does nothing?:

ClearAll["Global`*"]

(* Input Matrix *)
A = {{a, b}, {c, d}}

cp = Collect[CharacteristicPolynomial[A, x], x] // TraditionalForm
cl = CoefficientList[cp, x]

This method won't allow CoefficientList[ ] to function properly:

ClearAll["Global`*"]

(* Input Matrix *)
A = {{a, b}, {c, d}}

cp = Collect[CharacteristicPolynomial[A, x], x] // 
  PolynomialForm[#, TraditionalOrder -> True] &
cl = CoefficientList[cp, x]

From another answer on polynomial rearranging, also prevent CoefficientList[] from working:

ClearAll["Global`*"]

(* Input Matrix *)
A = {{a, b}, {c, d}}

c0 = Collect[CharacteristicPolynomial[A, x], x] 
cx = CoefficientList[c0, x] x^Range[0, Exponent[c0, x]]
cp = Replace[Reverse@cx, List[x__] :> HoldForm[Plus[x]]]
cl = CoefficientList[cp, x]

I've tried other method outlined in past answers, but none seem to work with CoefficientList[ ] ? What gives?

$\endgroup$
2
$\begingroup$

Using TraditionalForm[ ] does nothing?:

Need to use ParameterVariables

ClearAll["Global`*"]

vars = {a, b, c, d};
(*Input Matrix*)
A = {{a, b}, {c, d}}
cp = Collect[CharacteristicPolynomial[A, x], x]
TraditionalForm[cp, ParameterVariables -> vars]

Mathematica graphics

Reference: http://reference.wolfram.com/language/tutorial/PolynomialOrderings.html

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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