Related to Hilbert's Tenth problem.


Is there polynomial with integer coefficients $P(a,x\_1,...,x\_n)$
such that $P(A,X\_i)=0$ has rational solutions $X\_i$ iff $A$ is
not the square of integer (or as another question not the square
of rational)?


We think if $P$ is homogeneous and ask about integer solutions,
scaling the solution might cause problems: $A^2,A X\_1, A X\_2, ...$


Over the integers solution is trivial via Pell equation:


$$
(2+x\_1^2+x\_2^2+x\_3^2+x\_4^2)^2- a x\_5^2=1
$$



Rational Diophantine set for the non-squares
The set $A$ of non-squares (of rationals) is Diophantine in $\mathbb{Q}$ by [1]. The set $B:=\mathbb{Q}\smallsetminus\mathbb{Z}$ is also Diophantine by [2]. The set of non-squares of integers is equal to $A\cup B$, hence Diophantine. 


For a generalization of [1], see also [3]. 


**[EDIT]** The paper [1] treats arbitrary (non-)$n$-th powers, but the case of (non-)squares was proved earlier by Poonen [4].


[1] *Colliot-Thélène, Jean-Louis; van Geel, Jan*, [**Le complémentaire des puissances $n$-ièmes dans un corps de nombres est un ensemble diophantien**](http://dx.doi.org/10.1112/S0010437X15007368), Compos. Math. 151, No. 10, 1965-1980 (2015). [ZBL1346.14066](https://zbmath.org/?q=an:1346.14066).. 


[2] *Koenigsmann, Jochen*, [**Defining $\mathbb Z$ in $\mathbb Q$**](http://dx.doi.org/10.4007/annals.2016.183.1.2), Ann. Math. (2) 183, No. 1, 73-93 (2016). [ZBL1390.03032](https://zbmath.org/?q=an:1390.03032).. 


[3] *Dittmann, Philip*, [**Irreducibility of polynomials over global fields is diophantine**](http://dx.doi.org/10.1112/S0010437X17007977), Compos. Math. 154, 761-772 (2018). [ZBL06861881](https://zbmath.org/?q=an:06861881).


[4] 
*Poonen, Bjorn*, [**The set of nonsquares in a number field is diophantine**](http://dx.doi.org/10.4310/MRL.2009.v16.n1.a16), Math. Res. Lett. 16, No. 1, 165-170 (2009). [ZBL1183.14031](https://zbmath.org/?q=an:1183.14031).


