# How would one approach choosing 12 inputs to a formula, such that the square root of the output is a rational number?

I'm wondering how one would approach finding a combination of rational values for 12 variables $P_1,P_2,\cdots,P_{12}$, such that the square root of alpha, related to $P_1,\cdots,P_{12}$ by:

$\alpha= - \frac{P_3*P_7-P_1*P_5-P_2*P_6-P_4*P_8}{(P_3*P_{11}-P_1*P_9-P_2*P_{10}-P_4*P_{12})+(P_7*P_{11}-P_5*P_9-P_6*P_{10}-P_8*P_{12})}$

would be a rational number?

Incessant trial and error has always given an irrational answer. I can only think that $\alpha=-\frac{c^2}{d^2}$ for some integers $c, d$ for it to be a rational but that condition doesn't provide enough of a guideline.

Any suggestions greatly appreciated.

Solving for the numerator to be equal to $-c^2$ for some $c \in \mathbb{Q}$.

We get that $P_1=\frac{c^2-P_2 P_6+P_3 P_7-P_4 P_8}{P_5}$ assuming that $P_5 \not=0$.

Solving for the denominator to be equal to $d^2$ for some $d \in \mathbb{Q}$.

We get that $P_{12}=\frac{-d^2-P_1 P_9-P_{10} P_2-P_{10} P_6+P_{11} P_3+P_{11} P_7-P_5 P_9}{P_4+P_8}$ assuming $P_4+P_8 \not=0$.

thus we get that $\alpha = - \frac{-c^2}{d^2} = \frac{c^2}{d^2}$ and so $\sqrt{\alpha} = \frac{c}{d}$ assuming $d \not= 0$.

For instance :

$c=\frac{1}{2}$ and $P_2=\frac{1}{3} , P_3 = \frac{1}{4} , P_4 = \frac{2}{5} , P_5 = \frac{3}{7} , P_6 = \frac{2}{11} , P_7 = \frac{4}{9} , P_8 =\frac{1}{8}$ from these we can compute $P_1$ value which is $P_1 = \frac{868}{1485}$

Now $d=\frac{3}{2}$ and $P_9 = \frac{1485}{217} , P_{10} = \frac{7}{11} , P_{11}=\frac{1}{5}$ from these we can compute $P_{12}$ value which is $P_{12} = -\frac{620108920}{34738011}$

thus $\sqrt{\alpha} = \frac{c}{d} = \frac{\frac{1}{2}}{\frac{3}{2}} = \frac{1}{3}$

Now this guarantees that $\sqrt{\alpha} \in \mathbb{Q}$ but by far its not the only way, there is too many ways to ensure square root of $\alpha$ is rational because you have $14$ variables in one equation, meaning you have $13$ Degrees of freedom.

• What a fantastic answer thank you! It didn't even occur to me to equate the numerators and denominators separately! – Nyika Sep 9 '17 at 11:07
• @Nyika you are welcome (: – Ahmad Sep 9 '17 at 11:12