Prove that two lines are perpendicular to each other if and only if their slopes are negative reciprocals of each other
Proof: Let $l_1$ and $l_2$ be arbitrary lines.
$(\rightarrow)$ Suppose that $l_1$ and $l_2$ are perpendicular. Then the angle between the two lines is $90^\circ$. Suppose that $l_2$ is the line with a greater angle of inclination. Then $A_1 = A_2 - 90^\circ$. Then \begin{align} m_1 &= \tan(A_1) \\ &= \tan(A_2 - 90^\circ) \\ &= \frac{\sin(A_2-90^\circ)}{\cos(A_2 - 90^\circ)} \\ &= \frac{\sin(A_2)\cos(-90) + \sin(-90)\cos(A_2)}{\cos(A_2)\cos(-90)-\sin(A_2)\sin(-90)} \\ &= - \frac{\cos(A_2)}{\sin(A_2)} \\ &= - \frac{1}{\tan(A_2)} = - \frac{1}{m_2} \end{align} $(\leftarrow)$ Now suppose that the slopes of $l_1$ and $l_2$ are negative reciprocals of each other. Then $m_1 = \tan(A_1) = - \frac{1}{\tan(A_2)} = - \frac{1}{m_2}$...
How can I go about completing this part of the proof? I tried considering the formula for the tangent of the angle between two lines, but that does not seem to work since $\tan(90^\circ)$ is undefined.
If $m_1m_2 = -1$, then $\tan \theta_1 \tan \theta_2 = -1$, where $\theta_1, \theta_2$ are the angles of each line with the x axis. Therefore $\sin \theta_1 \sin \theta_2 + \cos \theta_1 \cos \theta_2 = 0$, so $\cos(\theta_1 - \theta_2) = 0$. Can you complete the proof from here?