Let \(\mathbf{M} = \begin{pmatrix} a & b \\ c & d \end{pmatrix}\) be a real matrix with \(a \neq d\). The transformation represented by \(\mathbf{M}\) has exactly two distinct invariant lines through the origin.
Show that, if neither invariant line is the \(y\)-axis, then the gradients of the invariant lines are the roots of the equation
\[bm^2 + (a-d)m - c = 0.\]
If one invariant line is the \(y\)-axis, what is the gradient of the other?
Show that, if the angle between the two invariant lines is \(45^\circ\), then
\[(a-d)^2 = (b-c)^2 - 4bc.\]
Find a necessary and sufficient condition, on some or all of \(a\), \(b\), \(c\) and \(d\), for the two invariant lines to make equal angles with the line \(y = x\).
Give an example of a matrix which satisfies both the conditions in parts (ii) and (iii).