Problem

Source: Gillis Olympiad 5777 (Israel National '16-'17) #4

Tags: algebra, national olympiad, number theory, Diophantine equation



Three rational number $x,p,q$ satisfy $p^2-xq^2$=1. Prove that there are integers $a,b$ such that $p=\frac{a^2+xb^2}{a^2-xb^2}$ and $q=\frac{2ab}{a^2-xb^2}$.