I'm trying to simplify the following expression:
$$ 2 y + \lceil \frac{x - y(y + 1)}{y + 1} \rceil + 1 $$
where
$$ y = \lfloor \frac{\sqrt{4x + 1} - 1}{2} \rfloor $$
(I deliberately cut up the expression using $y$ for readability, do tell me if I shouldn't.)
The problem is I think this expression should be equal to $\lceil 2 \sqrt{x} \rceil$ for any integers x, but I'm not able to prove it. The values for the first $2^{64}$ integers correspond, but this is of course no formal proof. I'm stuck at the moment at expression:
$$ \lceil \frac{x}{y} \rceil + y $$
where
$$ y = \lfloor \frac{\sqrt{4x + 1} + 1}{2} \rfloor $$
although this may be a dead end.
I guess my question also includes the more general question: how does one prove an equality between two expressions with variable $x \in \mathbb{N}$ containing floor and ceiling functions?