calculate the values of p and q Analytical geometry

I strongly recommend that you mind your p's and q's