[Math] Equation of a line after being reflected in another line using the transformation matrix

geometrylinear algebramatrices

For a specific case, consider the line $ y = 3x + 1 $. How can I find the equation of the new line when this is reflected in the line $ y = 2x $ ? I would like to solve this using solely matrices and not considering angles of lines.

My attempt:

The general matrix transformation for a reflection in $ y = mx $ is

$ \dfrac{1}{1+m^2}\begin{bmatrix}
1-m^2 & 2m \\
2m & m^2-1
\end{bmatrix} $
so when $ m = 2 $, $ \mathbf{T} = \dfrac{1}{5} \begin{bmatrix}
-3 & 4 \\
4 & 3
\end{bmatrix} $

Using the vector equation of a line, $ y = 3x+1 $ can be written as

$ \mathbf{r} = \begin{bmatrix}
0\\
1
\end{bmatrix} +\lambda \begin{bmatrix}
1\\
3
\end{bmatrix} = \begin{bmatrix}
\lambda \\
3\lambda +1
\end{bmatrix} $

Applying the transformation,

$ \mathbf{r}' = \mathbf{T} \ \mathbf{r} = \dfrac{1}{5}\begin{bmatrix}
-3 & 4\\
4 & 3
\end{bmatrix}\begin{bmatrix}
\lambda \\
3\lambda +1
\end{bmatrix} = \dfrac{1}{5}\begin{bmatrix}
9\lambda +4\\
13\lambda +3
\end{bmatrix} $

Converting back to Cartesian,

$ x = 9\lambda + 4 \rightarrow \lambda = \dfrac{x-4}{9} $

$ y = 13 \left ( \dfrac{x-4}{9} \right ) + 3 $

$ 9y = 13x-25 $.

However some graphing on Desmos shows this is not correct, and the right answer looks more like $ 9y = 13x-5 $.
Any help in finding where is my mistake is much appreciated.

Best Answer

There is a much faster way to make the computations: remember that a reflection is its own inverse, so if $\mathbf r'$ has coordinates $(x',y')$, we have $$\mathbf r=T\mathbf r'\iff \begin{pmatrix}x\\y\end{pmatrix}=T\begin{pmatrix}x'\\y'\end{pmatrix}=\tfrac 15 \begin{pmatrix}-3x'+4y'\\4x'+3y'\end{pmatrix}$$ and plugging this relation in the equation of the line $y=3x+1$, we obtain \begin{align} \frac 15(4x'+3y')&=\frac 35(-3x'+4y')+1\iff 4x'+3y'=-9x'+12 y'+5\\&\iff13x'-5=9y'. \end{align}