<s>[INST] How do I transform the equation based on the condition? If $q$ and $w$ are the roots of the equation $$2x^2-px+7=0$$ 
Then $q/w$ is a root of ? 
P.s:- It is an another question of How do I transform the equation based on this condition?
 [/INST] Let $y=\frac{q}{w}$.
Clearly, q,w are $\frac{p ±\sqrt{p^2-56}}{4}$
If we take q to be $\frac{p +\sqrt{p^2-56}}{4}$, w is $\frac{p -\sqrt{p^2-56}}{4}$
So, $y=\frac{q}{w}=\frac{p +\sqrt{p^2-56}}{p -\sqrt{p^2-56}}$
Applying componendo dividendo, $\frac{y+1}{y-1}=\frac{p}{\sqrt{p^2-56}}$
On squaring, 
 $\frac{y^2+1+2y}{y^2+1-2y}=\frac{p^2}{p^2-56}$
Applying componendo dividendo again, $\frac{y^2+1}{2y}=\frac{p^2-28}{28}$
or, $28y^2-2(p^2-28)y+28=0$ 
$=>14y^2-(p^2-28)y+14=0$ is the desired equation  whose one root is $\frac{q}{w}$.
If we take q to be $\frac{p -\sqrt{p^2-56}}{4}$, w is $\frac{p +\sqrt{p^2-56}}{4}$
So, $y=\frac{q}{w}=\frac{p -\sqrt{p^2-56}}{p +\sqrt{p^2-56}}$
Applying componendo dividendo, $\frac{y+1}{y-1}=-\frac{p}{\sqrt{p^2-56}}$
On squaring we shall get the desired quadratic equation whose one root is $\frac{q}{w}$.
Just observe that both the derived equations are same.
This is the minimal equation with rational coefficients for any integer p.
If we  allow irrational coefficients, $\frac{q}{w}$ will be a root y=$\frac{p -\sqrt{p^2-56}}{p +\sqrt{p^2-56}}$  or y=$\frac{p + \sqrt{p^2-56}}{p - \sqrt{p^2-56}}$.
</s>