Slope of axes of a General Conic Section 
A General Conic Section is given by the equation $ax^2 + by^2 + 2hxy +2gx +2fy + c =0 $. Let the $\theta$ be the slope of one of its axes.
Prove that :
$$\tan 2\theta = \dfrac{2h}{a-b}$$

I tried to use the definition of the conic section by taking cases for various conics such as parabola, pair of straight lines, ellipse, hyperbola etc. but it became too tedious to calculate. Are there some properties with which this question can be simplified ?
Any help will be appreciated.
Thanks.
 A: if you shift the origin to eliminate the linear terms the equation becomes
$$
rMr^T = C
$$
where $r$ is the 2-vector $(x,y)$ and $M$ is the matrix 
$$M = \begin{pmatrix} a & h \\ h & b \end{pmatrix}
$$
and $C$ is a constant.
If the axes are rotated through an angle $\theta$ the matrix is diagonalized when the off-diagonal terms in
$$
\begin{pmatrix} \cos \theta & \sin \theta \\ -\sin \theta & \cos \theta \end{pmatrix}
\begin{pmatrix} a & h \\ h & b \end{pmatrix}
\begin{pmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{pmatrix}
$$
are zero. For the top right entry this requirement translates to:
$$
(a\cos \theta+h\sin \theta)(-\sin \theta)+(-h \sin \theta+b\cos \theta)\cos \theta = 0
$$
i.e.
$$
h(\cos^2\theta -\sin^2 \theta)= (a-b)\sin\theta\cos\theta
$$
from which the stated result follows
A: If we rotate the axes through $\theta$ to new axes $x',y'$ we have $x=x'\cos\theta-y'\sin\theta,y=x'\sin\theta+y'\cos\theta$. Hence the coefficient of $x'y'$ becomes $-2a\cos\theta\sin\theta$ (from the $ax^2$ term) plus $2b\cos\theta\sin\theta$ (from the $by^2$ term) plus $2h(\cos^2\theta-\sin^2\theta)$ (from the $2hxy$ term).
So the $x'y'$ term has zero coefficient if $(a-b)\sin2\theta=2h\cos2\theta$ or $\tan2\theta=\frac{2h}{a-b}$.
But zero $xy$ term is precisely the condition for the axes of the conic to be lined up with the coordinate axes. Hence the slope of one of its axes (in the original $xy$ coordinate system) is $\theta$ where $\tan2\theta=\frac{2h}{a-b}$.
