Rotation of a line by a matrix 
Give the equation of the line $\ell'$ that is obtained by rotating $\ell$: $x+2y=5$ by an angle of $\theta=\frac{1}{2}\pi$ with center point $O(0,0)$.

The rotation matrix is $\left.\begin{pmatrix}\cos \alpha & -\sin \alpha \\ \sin \alpha & \cos \alpha\end{pmatrix}\right|_{\alpha=\frac{1}{2}\pi}=\begin{pmatrix}0 & -1 \\ 1&0\end{pmatrix}$. Two points on $\ell$ are $(1,2)$ and $(3,1)$, whose images are respectively $\begin{pmatrix}0 & -1 \\ 1&0\end{pmatrix}\begin{pmatrix}1\\2\end{pmatrix}=\begin{pmatrix}-2\\1\end{pmatrix}$ and $\begin{pmatrix}0 & -1 \\ 1&0\end{pmatrix}\begin{pmatrix}3\\1\end{pmatrix}=\begin{pmatrix}-1\\3\end{pmatrix}$.
Hence, the gradient of $\ell'$ is $\dfrac{\Delta y}{\Delta x}=2$. Therefore, the equation of $\ell'$ is $y=2(x+2)+1\iff \boxed{y=2x+5}$.

I have two questions: my book says the answer should be $y=2x+6$. If I am wrong, what did I wrong? Second, is there anyone who suggests a more elegant of faster method for this problem?

A shorter way:
Given line is $x+2y=5$, so we could say $x=r$ and $y=\dfrac{5-r}{2}$.
Now we multiply $\begin{pmatrix} 0&-1\\1&0\\ \end{pmatrix}\begin{pmatrix} r\\ \dfrac{5-r}{2}\\ \end{pmatrix}$, it gives us coordinates after rotation which are
$\begin{pmatrix} \dfrac{r-5}{2}\\ r\\ \end{pmatrix}$. namely, the new $x=\dfrac{r-5}{2}$ and the new $y=r$, so the line after rotation is $y=2x+5$
