The matrix $\mathbf{M}$ represents the sequence of two transformations in the $x$-$y$ plane given by a stretch parallel to the $x$-axis, scale factor $k$ ($k\ne0$), followed by a shear, $x$-axis fixed, with $(0,1)$ mapped to $(k,1)$.
a. Show that $\mathbf{M}=\begin{pmatrix}k&k\\0&1\end{pmatrix}$. [4]
b. The transformation represented by $\mathbf{M}$ has a line of invariant points. Find, in terms of $k$, the equation of this line. [3]
The unit square $S$ in the $x$-$y$ plane is transformed by $\mathbf{M}$ onto the parallelogram $P$.
c. Find, in terms of $k$, a matrix which transforms $P$ onto $S$. [1]
d. Given that the area of $P$ is $3k^2$ units$^2$, find the possible values of $k$. [2]