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?

I notice that the point $(1,2)$ is on the original line. After a rotation by $\pi/2$, this point becomes $(-2,1)$. I also notice that the original slope was $-1/2$. A rotation by $\pi/2$ has the effect of finding a line perpendicular to our starting line, so it will have slope $2$.
The equation of a line with slope $2$ passing through $(-2,1)$ is $y - 1 = 2(x + 2)$, or rather $y = 2x + 5$.
