Find $x$ such that $\sqrt{x+\sqrt{x+7}}\in \mathbb{N}$

If you just want to find some $x$, not all, you can try to find $x$ such that $\sqrt{x+7} = 7$, as then $$ \sqrt{x + \sqrt{x+7}} = \sqrt{x+7} = 7 \in \mathbb N.$$ Can you see such an $x$?


$$x + 7 = ((n^2)-x)^2 = n^4 - 2n^2x + x^2$$ $$x^2-(2n^2+1)x+n^4-7=0$$ $$x_{1,2}=\frac{2n^2+1 \pm \sqrt{(2n^2+1)^2-4(n^4+7)}}{2}\\ =\frac{2n^2+1 \pm \sqrt{4n^4+4n^2+1-4n^4+28}}{2}\\ =\frac{2n^2+1 \pm \sqrt{4n^2+29}}{2}\\$$

This is an integer if and only if $ \sqrt{4n^2+29}$ is an integer (the converse follows immediately from the observation that if $\sqrt{4n^2+29}$ is an integer, it must be odd.

Claim 1: If $\sqrt{4n^2+29}$ is an integer, then $n \leq 7$.

Proof: $$\sqrt{4n^2+29} > \sqrt{4n^2}=2n \,.$$ Thus $$\sqrt{4n^2+29} \geq 2n+1 \,.$$ Hence $$4n^2+29 \geq 4n^2+4n+1 \,.$$

This implies that $n \leq 7$, with equality if and only if $n=7$.

Claim 2: If $\sqrt{4n^2+29}$ is an integer, and $n \neq 7$ then $n \leq 1$.

Proof: Exactly like in Claim $1$ $$\sqrt{4n^2+29} \geq 2n+1 \,.$$

But we proved that we only have equality for $n=7$. Thus $$\sqrt{4n^2+29} > 2n+1 \,.$$

As $\sqrt{4n^2+29}$ is odd, we get $$\sqrt{4n^2+29} \geq 2n+3 \,.$$ $$4n^2+29 \geq 4n^2+12n+9 \,.$$ $$29 \geq 12n+9 \,.$$

Thus $n \leq 1$.

Thus we showed that the only $n$ which can work are $n = 0, n = 1$ and $n = 7$.

If $$n=0 \Rightarrow x_{1,2} =\frac{1 \pm \sqrt{29}}{2} \notin \mathbb Z$$ $$n=1 \Rightarrow x_{1,2} =\frac{2+1 \pm \sqrt{4+29}}{2}\notin \mathbb Z$$ $$n=7 \Rightarrow x_{1,2} =\frac{99 \pm 15}{2}$$

P.S. Don't forget that we squared couple times, which means that the solutions we got are solutions to $$x + 7 = ((n^2)-x)^2 = n^4 - 2n^2x + x^2$$ but not necessarily to the original question.

One needs to check them in the original equation, and only one works.

The reason why the other solution doesn't work is because it appears as an extra solution when we square: $$\sqrt{x + 7 }= (n^2)-x$$

If we observe in the original equation that $n^2 \geq x$, this eliminates the wrong extra solution .


Trial and Error

I assume you want $x$ to be an integer. You might want $x+7$ to be a square so that $\sqrt{x+7}\in\mathbb{N}$... $x+7\in\{1,4,9,16,25,36,49,64\dots\}$ and hence $$\begin{align}x&\in\{-6,-3,2,18,29,42,57,\dots\} \end{align}$$

But you want $x+\sqrt{x+7}$ to be a square so look at the corresponding values of it:

$$x+\sqrt{x+7}\in\{-5,-1,5,22,34,49,65,\dots\}.$$

One of these is squares, corresponding to $x=42$.