Solutions to $\frac{Q\partial P}{x\partial x}-\frac{P\partial Q}{x\partial x}-\frac{Q\partial P}{y\partial y}+\frac{P\partial Q}{y\partial y}=0$ We have 
$$
F(x,y)= \frac{Q}{x} \frac{\partial P}{\partial x}
- \frac{P}{x} \frac{\partial Q}{\partial x}  
- \frac{Q}{y} \frac{\partial P}{\partial y} 
+ \frac{P}{y} \frac{\partial Q}{\partial y} 
$$
where 
$$P = \sum_{i=1}^{N}(a_i x + b_i y)^2 $$
$$Q = \sum_{i=1}^{N}(c_{i} x + d_{i} y)^2$$
and $a_i, b_i, c_{i}, d_{i}$ are constant parameters defined for $1\leq i,j \leq N$.
We want to find the solutions of equation $F(x,y)=0$. For a simpler case, where $P$ is defined as above and $Q=1$, by using a change of variable $m=\frac{y}{x}$, we get a quadratic equation for $m$ that could be simply solved and give the two solutions for $m$. I wonder if using same change of variable, one could obtain the solutions for the more general case (with $Q$ of the form given above or similar form). 
Some background: $x,y$ are coordinates of a point in a two dimensional space and define a line that passes through $(x,y)$ and the origin $(0,0)$. $P$ and $Q$ are derived from projection of some other points on this line. Using $m=y/x$ makes sense since the projections only depend on the slope of the line and not the actual values of $(x,y)$. Our goal is to find the line (defined by its slope $m$) that satisfies $F(x,y)=0$.
EDIT: This problem is the special case for a more general problem to find the mapping from an $N$ dimensional space to an $M$ dimensional space that would minimize sum of distances of pairs of similar points ($P$) normalized to sum of distances of pairs of dissimilar points ($Q$). The solution given here solves it for mapping from 2D to 1D. I also posted a new question for the case mapping from 3D to 1D here which I expect to be solvable in a similar way.
 A: Using some help from Mathematica I came to this answer: 
$F(x,y)=0$ for $m= \frac{y}{x} = \frac{-B\pm\sqrt{B^2-4AC}}{2A}$
where
$A = (\sum_{i=1}^{N}b_i^2)(\sum_{i=1}^{N}c_i d_i)-(\sum_{i=1}^{N}d_i^2)(\sum_{i=1}^{N}a_i b_i)$
$B = (\sum_{i=1}^{N}b_i^2)(\sum_{i=1}^{N}c_i^2)-(\sum_{i=1}^{N}a_i^2)(\sum_{i=1}^{N}d_i^2)$
$C = (\sum_{i=1}^{N}c_i^2)(\sum_{i=1}^{N}a_i b_i)-(\sum_{i=1}^{N}a_i^2)(\sum_{i=1}^{N}c_i d_i)$
Any idea for a simple derivation, verification or interpretation?
A: Recall that a function $f$ of two variables is homogeneous of degree $k$ if
$$
 \forall \lambda > 0, \quad f(\lambda x, \lambda y) = \lambda^k f(x,y);
$$
by (the easy direction of) Euler's homogeneous function theorem, it follows that
$$
 (x\partial_x +y\partial_y)f = kf,
$$
which, in terms of polar coordinates $(r,\theta)$, can be rewritten as
$$
 r\partial_rf = kf.
$$
Now, suppose, for simplicity, that $P > 0$. Observe that $R := \frac{Q}{P}$ is homogeneous of degree $0$, so that $r\partial_r R = 0$, and hence that $R = f(\theta)$ for some function $f$ of a single variable. As a result, since
$$
 F = \frac{P(x,y)^2}{xy} \cdot (y\partial_x - x\partial_y)R = -\frac{P}{xy} \cdot \partial_\theta R = -\frac{P}{xy} \cdot f^\prime(\theta),
$$
it follows that $F(x,y) = 0$ if and only if $f^\prime(\theta(x,y)) = 0$, i.e., that the solution set of $F(x,y) = 0$ is the union of all rays of the form $\theta(x,y) = \theta_0$, where $\theta_0$ is a zero of $f^\prime$. In particular, if you restrict to first quadrant $x, y > 0$, the equation $F(x,y) = 0$ is equivalent to the equation
$$
 f^\prime\left(\arctan\left(\frac{y}{x}\right)\right) = 0.
$$
To cut a long story short, if $P > 0$ and $Q$ are both homogeneous of the same degree, and if you're only concerned with the first quadrant $x,y > 0$, then
$$
 \partial_\theta \left(\frac{Q}{P}\right)(x,y) = (-y\partial_x+x\partial_y)\left(\frac{Q}{P}\right)(x,y) = g(y/x)
$$
for some function $g$ of one variable, in which case the equation $F(x,y) = 0$ reduces to the equation
$$
 g(m) = 0
$$
for $m = \frac{y}{x}$.
