Let $x$ be a non-zero real number such that $x+\frac{1}{x}=\sqrt{2019}$. What is the value of $x^{2}+\frac{1}{x^{2}}$?
On a $2019=\left(x+\frac{1}{x}\right)^{2}=x^{2}+\frac{1}{x^{2}}+2$, so $x^{2}+\frac{1}{x^{2}}=2017$.