Rational and Jordan canonical forms

Let A be the 4Γ—4 matrix

A=[10000100βˆ’2βˆ’201βˆ’20βˆ’1βˆ’2].
  1. Show that the invariant factors of A are a1(x)=xβˆ’1, a2(x)=(xβˆ’1)(x+1)2.
  2. Determine the rational canonical form R of A and find a change-of-basis matrix P such that Pβˆ’1AP=R.
  3. Determine the Jordan canonical form J of A. (Optionally: find a change-of-basis matrix Q such that Qβˆ’1AQ=J.)