Deriving conditions for a pair of straight lines to be parallel. If was trying to do the following question.

Prove that the pair of straight lines
      $ax^2+ 2hxy + by^2 + 2gx +2fy+ c = 0$ are parallel if $h^2 = ab$
       and $bg^2 = af^2$

Here's what I tried.
I partially differentiated the give equation with respect to x and y to get these equations 
$ax + hy + g = 0$ and
 $hx + by + f = 0$
Now since intersection of these lines gives the intersection of the given pair of straight lines, both of these must be parallel to have no intersection. Therefore,
$a/h = h/b = g/f$
I am doubtful if my method is correct. Please provide with better solution if there's any. Thanks.

Two parallel lines can be represented as
$$
a_1 x + b_1 y + c_1 = 0\\
\mu a_1 x + \mu b_1 y + c_2 = 0
$$
so equating the coefficients 
$$
(a_1 x + b_1 y + c_1)(\mu a_1 x + \mu b_1 y + c_2) = a x^2 + 2 h x y + b y^2 + 2 g x + 2 f y + c
$$
we get the relations
$$
\cases{
a = \mu a_1^2\\
b = \mu b_1^2\\
h = \mu a_1 b_1\\
g = \frac 12(\mu a_1c_1+a_1c_2)\\
f = \frac 12(\mu b_1 c_1+b_2 c_2)\\
c = c_1c_2
}
$$
and substituting those relationships we obtain
$$
\cases{
h^2-a b = 0\\
b g^2-a f^2 = 0
}
$$
