This is really just an outline of the proof, as several of the algebraic steps have been left to the reader. Begin with a line, $\ell,$ and a point, $P(x_{1},y_{1}),$ not on the line. Let $\ell$ have the equation of standard form. \[ \left(\ell\right):\qquad ax+by+c=0 \] If we cast this equation into slope intercept form, it will be \[ y=\frac{-a}{b}x-\frac{b}{c} \] and we get the slope $-\frac{a}{b}.$ From that slope, we can take the negative reciprocal and write an equation of a line that passes through $P$ and is perpendicular to $\ell.$ We will call this line $d.$ \[ \left(d\right):\qquad y-y_{1}=\frac{b}{a}\left(x-x_{1}\right) \]

Next we will solve simultaneously $\left(\ell\right)$ and $\left(d\right)$ to get the right angle intersection point coming from $P.$ Here, the algebra has been done by Geogebra. We will name this point $E.$ \[ E:\left\{ x=\frac{-a\;b\;y_{1}-a\;c+b^{2}\;x_{1}}{a^{2}+b^{2}},y=\frac{a^{2}\;y_{1}-a\;b\;x_{1}-b\;c}{a^{2}+b^{2}}\right\} \] Use the distance formula, which we have proved from Pythagoras, to get the distance between $P$ and $E.$ \[ |P-E|=\sqrt{\left(\frac{-a\;b\;y_{1}-a\;c+b^{2}\;x_{1}}{a^{2}+b^{2}}-x_{1}\right)^{2}+\left(\frac{a^{2}\;y_{1}-a\;b\;x_{1}-b\;c}{a^{2}+b^{2}}-y_{1}\right)^{2}} \] From here to the end is all algebra. I will show a few of the steps.

- In each of the two squared terms under the root, combine the $-x_{1}$ and $-y_{1}$ into the numerator. This yields \[ \sqrt{\left(\frac{-a^{2}x_{1}-aby_{1}-ac}{a^{2}+b^{2}}\right)^{2}+\left(\frac{-b^{2}y_{1}-abx_{1}-bc}{a^{2}+b^{2}}\right)^{2}}. \] That is quite easy and you can do the algebra on paper.
- Now distribute the square and factor the denominators. \[ \sqrt{\frac{1}{\left(a^{2}+b^{2}\right)^{2}}\left(\left(-a^{2}x_{1}-aby_{1}-ac\right)^{2}+\left(-b^{2}y_{1}-abx_{1}-bc\right)^{2}\right)} \]
- Remove the left side term. \[ \frac{1}{\left(a^{2}+b^{2}\right)}\sqrt{\left(\left(-a^{2}x_{1}-aby_{1}-ac\right)^{2}+\left(-b^{2}y_{1}-abx_{1}-bc\right)^{2}\right)} \]
- The terms under the root can be expanded and collected. Having done so, we will discover that the expression becomes: \[ \frac{1}{\left(a^{2}+b^{2}\right)}\left(\left(ax_{1}+by_{1}+c\right)\sqrt{a^{2}+b^{2}}\right). \] It is easiest to show the algebra in reverse. That is, begin with the result above and square it to put it inside the root. I will not do that part here as you will find 12 terms under the root, after squaring and collecting terms.
- Clearly, the equation above is equal to \[ dist=|P-E|=\frac{ax_{1}+by_{1}+c}{\sqrt{a^{2}+b^{2}}}\qquad\blacksquare \]

This will be exactly the same scheme used for standard form. We will write an equation for a line. Then we will write an equation for the perpendicular line that goes through point $P.$ Then we will solve them simultaneously to get the intersection point. Finally, we will use the distance formula to obtain the length from $P$ to the intersection.

- The line: $y=mx+b.$
- The perpendicular line through $P(x_{1,}y_{1}).\qquad y-y_{1}=-\frac{1}{m}\left(x-x_{1}\right).$
- The simultaneous solution, solving for $E=intersection(x,y).$ \[ E=\left(\frac{-bm+my_{1}+x_{1}}{m^{2}+1},\ \frac{b+m^{2}y+mx_{1}}{m^{2}+1}\right) \]
- The distance. \[ |E-P|=\sqrt{\left(\frac{-bm+my_{1}+x_{1}}{m^{2}+1}-x_{1}\right)^{2}+\left(\frac{b+m^{2}y+mx_{1}}{m^{2}+1}-y_{1}\right)^{2}} \]
- Combine terms in parentheses. \[ |E-P|=\sqrt{\left(\frac{mx_{1}^{2}+bm-my_{1}}{m^{2}+1}\right)^{2}+\left(\frac{mx_{1}+b-y_{1}}{m^{2}+1}\right)^{2}} \]
- and \[ \sqrt{\frac{b^{2}+2\;b\;m\;x_{1}-2\;b\;y_{1}+m^{2}\;x_{1}^{2}-2\;m\;x_{1}\;y_{1}+y_{1}^{2}}{m^{2}+1}} \]
- Simplify. \[ \left|E-P\right|=\frac{mx_{1}+b-y_{1}}{\sqrt{m^{2}+1}} \]