I have been doing $\varepsilon$-$\delta$ proofs for fun and I challenged myself to prove $$\displaystyle\lim_{x\to\infty}\left(\sqrt{(x+a)(x+b)}-x\right)=\frac{a+b}{2},\quad a,b\in\mathbb{R}$$
The definition says: We say that $\displaystyle\lim_{x\to\infty}f(x)=l$ if for any positive number $\varepsilon$ we can find a positive number $N$ (depending on $\varepsilon$ in general) such that $|f(x)-l|<\varepsilon$ whenever $x>N$.
So I started with: $\left|\sqrt{(x+a)(x+b)}-x-\dfrac{a+b}{2}\right|<\varepsilon$ whenever $x>N$.
Manipulating the first inequatlity
\begin{gather*} -\varepsilon<\sqrt{(x+a)(x+b)}-x-\dfrac{a+b}{2}<\varepsilon\\ -\varepsilon+\dfrac{a+b}{2}<\sqrt{(x+a)(x+b)}-x<\varepsilon+\frac{a+b}{2} \end{gather*}
At this point I thought about adding $x$, squaring the expressions and then expanding them. I did it and I got: $$\frac{a^2}{4}+\frac{ab}{2}+\frac{b^2}{4}+ax+bx+x^2-a\varepsilon-b\varepsilon-2x\varepsilon+\varepsilon^2<x^2+ax+bx+ab<\frac{a^2}{4}+\frac{ab}{2}+\frac{b^2}{4}+ax+bx+x^2+a\varepsilon+b\varepsilon+2x\varepsilon+\varepsilon^2$$
And here I'm not sure how to proceed. Am I on the right track?
Thanks for any help / hints.
Note: There might be other ways to prove this, but I'd like to do it using just algebra if possible, even if it's not the best method.
The "rationalization" trick are the same, but this may be the rigorous $\varepsilon$-$\delta$ proof you want.
Write $$\sqrt{(x + a)(x + b)} - x - \frac{a + b}{2} = \frac{(x + a)(x + b) - \left(x + \frac{a + b}{2}\right)^2}{\sqrt{(x + a)(x + b)} + \left(x + \frac{a + b}{2}\right)} = \frac{-\frac{(a - b)^2}{4}}{\sqrt{(x + a)(x + b)} + \left(x + \frac{a + b}{2}\right)}.$$
Therefore, $$ \left|\sqrt{(x + a)(x + b)} - x - \frac{a + b}{2}\right| = \frac{C}{\sqrt{(x + a)(x + b)} + \left(x + \frac{a + b}{2}\right)} < \frac{C}{x + \frac{a + b}{2}} \tag{1} $$ where $C = \dfrac{(a - b)^2}{4} \geq 0$, note the denominator is positive when $x$ is sufficiently large (say, $x > -(a + b)/2$) so the absolute value symbol can be removed. Given $\varepsilon > 0$, take $\delta = \max\left(\dfrac{C}{\varepsilon} - \dfrac{a + b}{2}, 1\right) > 0$, it then follows by $(1)$ that for all $x > \delta$, $$\left|\sqrt{(x + a)(x + b)} - x - \frac{a + b}{2}\right| < \varepsilon.$$