Prove that if $$\frac{a\sqrt{z}+b}{b\sqrt{z}+c}$$ is rational, then prove that $$\frac{a^2+b^2+c^2}{a+b+c}$$ is an integer.
I'm not sure how to start with this? my only guess is that the root must disappear therefore $a$, $b$, and $c$ are equal therefore $a=b=c$ but then again there might more to the problem that I can't see.
If $\sqrt{z}$ is irrational and $a,b,c,d\in\mathbb{Z}$ then for some $r\in\mathbb{Q}$, $$\frac{a\sqrt{z}+b}{b\sqrt{z}+c}=r\implies (rb-a)\sqrt{z}+(rc-b)=0\implies rb=a\;,\; rc=b.$$ Hence $c\not=0$, $r^2c=rb=a$ and $$\frac{a^2+b^2+c^2}{a+b+c}=\frac{(r^2c)^2+(rc)^2+c^2}{r^2c+rc+c}= \frac{c(r^4+r^2+1)}{r^2+r+1}=c(r^2-r+1)=a-b+c\in\mathbb{Z}.$$