Elementary Diophantine equation Solve $(x+y)(xy+1)=2^z$ in positive integres. My attempts is to use $x+y=2^a$, $xy=2^b-1$ and therefore $x,y$ are the roots of the quadratic equation $w^2-2^aw+2^b-1=0$. I try to analyze its dicriminant but it seems to be a dead end...

The idea of discriminant works nicely, as @Jyrki, @Andre and @Mike answered. Yet, I think of another (perhaps more "number theory"ish :) way.

First, the equation is symmetric in $x$ and $y$, hence without loss of generality, we assume $x\ge y$.

Since $xy+1$ divides $2^z$ and is not equal to $1$, then it should be even, meaning that $x$ and $y$ should both be odd. Let $x=2a+1$ and $y=2b+1$. A replacement yields
$$
4(a+b+1)(2ab+a+b+1)=2^z.
$$
Since $a+b+1$ is a power of $2$, $2ab+a+b+1$ will too be another power of $2$ only if $2ab=a+b+1$ or $2ab=0$ (a simple proof follows from assuming contrary). The latter case yields $b=0$ (or $a=0$) which means $y=1$ and $(x+1)^2=2^z$. Therefore, a set of solutions is found among $(x,y,z)=(2^u-1,1,2u)$ (and obviously $(x,y,z)=(1,2^u-1,2u)$). The former case yields
$$
{2ab=a+b+1\implies
\\(2a-1)(2b-1)=3\implies
\\(x-2)(y-2)=3\implies
\\x=5,y=3\implies z=7
\\\text{ or }
\\x=3,y=5\implies z=7
}.
$$

In conclusion, all the solutions are
$$
(x,y,z){\in
\left\{(2^u-1,1,2u):u\in\Bbb N\right\}
\\\cup
\left\{(1,2^u-1,2u):u\in\Bbb N\right\}
\\\cup
\left\{(3,5,7),(5,3,7)\right\}
}
$$

