In the above question, how have they written the ratio given in the first step of solution?
As both the points P and Q lie on the same line .
That's why their ratio is constant .