Minimum $a+b$ such that $ab=M$ This question is related to the fleablood's answer to another question.
Let $ab=M$ where $0<a,b,M\in\mathbb N$. He wanted to show that the sum $a+b$ is the smallest when $a,b$ are closest together. But he defined $a=\sqrt{M}r$, $b=\sqrt{M}/r$ with $r=1+e$ (where I suppose that $0<e\in\mathbb R$).
My question. Is it always possible to define the positive integers in $ab=M$ as $a=\sqrt{M}r$ and $b=\sqrt{M}/r$ with $r=1+e$? How would you show it?
Thanks in advance.
 A: Fleablood is ignoring the integer constraint there. They are looking at the problem of minimising $a + b$, where $a, b \in (0, \infty)$ such that $ab = M$. This is well known to be $2\sqrt{M}$, achieved at $a = b = \sqrt{M}$.
However, Fleablood is going a little further, given that there are extra constraints currently being (semi)-ignored. The point of the argument is to show that, under these constraints, the sum $a + b$ is a function of the distance between $a$ and $b$. Normally, this would be $|a - b|$, but if you assume $b \le a$ (which is not unreasonable), then it would be $a - b$.
Not only that, the sum is an increasing function of $a - b$. So, minimising $a + b$ would be equivalent to minimising $a - b$ according to the constraints of the question.
I find Fleablood's calculations a little convoluted for my tastes. I would make a substitution of $a + b = u$ and $a - b = v$ (both positive). Then $a = (u + v) / 2$ and $b = (u - v)/2$, and
$$M = ab = \frac{(u + v)(u - v)}{4} = \frac{u^2 - v^2}{4},$$
hence
$$u = \sqrt{v^2 + 4M}.$$
So, $u$ is an increasing function of $v$. That is, the larger the difference $a - b = v$, the larger the sum $a + b = u$.
As with Fleablood's answer, there's no mention of $a$ and $b$ being integers. We don't need $\sqrt{M}$, $r$, or $e$ (or $u$ or $v$, for that matter) to be integers either. But, once we add in the rest of the constraints, we now know we need to search for integers $a > b$, still multiplying to $M = 2 \cdot 25 \cdot 49 \cdot 61$, where $a - b$ is minimised.
A: Since $ab = M$, by setting $a = \sqrt{M}r$ we immediately get $b = \frac{\sqrt{M}}{r}$, for some $r > 0$.
Without loss of generality, we then assume $a \geq b$ (in other words, because everything in the problem is symmetrical we'll get the same solution if $a \geq b$ or $b \geq a$, so we pick one of them arbitrarily). The implication of that is:
$\sqrt{M}r \geq \frac{\sqrt{M}}{r} \implies r^2 \geq 1 \implies r \geq 1$
Then, since $r \geq 1$, if we set $r = 1 + e$ then that immediately implies $e \geq 0$.
It's important that $e = 0$ is a possibility, since for $M = 1$ the only factorisation is $a = b = 1$ which gives $r = 1$ and $e = 0$ as a result, and fleablood's solution does cover this.
A: The answer you cite didn't require $\ 0<e\ $, merely $\ 0\le e\ $.

*

*The two factors $\ a,b\ $ that are closest together with $\ a\ge b\ $ are obtained by taking  $\ b\ $ to be the largest factor of $\ M\ $ such that $\ b\le \sqrt{M}\ $. Then $\ a=\frac{M}{b}\ge\sqrt{M}$. If you put $\ r=\frac{\sqrt{M}}{b}\ $, then $\ r\ge1\ $, $\ a=r\sqrt{M}\ $, and $\ b=\frac{\sqrt{M}}{r}\ $.  If $\ e=r-1\ $ then $\ e\ge0\ $, but $\ e>0\ $ if and only if $\ M\ $ isn't a perfect square.

*If $\ M=1\ $ it's not possible to find two positive factors $\ a,b\ $ of $\ M\ $ such that $\ a=r\sqrt{M}\ $, $\ b=\frac{\sqrt{M}}{r}\ $ and $\ r=1+e\ $ with $\ e>0\ $.

*If $\ M>1\ $ then it's always possible to find two positive factors $\ a,b\ $ of $\ M\ $ such that $\ a=r\sqrt{M}\ $, $\ b=\frac{\sqrt{M}}{r}\ $ and $\ r=1+e\ $ with $\ e>0\ $.  You can take $\ a=M\ $ and $\ b=1\ $, for instance. But these two factors will not necessarily be the two that are closest together. You get the two factors that are closest together when $\ e\ $ is as small as possible, and when $\ M\ $ is a perfect square, the smallest possible value of $\ e\ $ is $\ 0\ $, when $\ a=b=\sqrt{M}\ $ and $\ r=1\ $.

A: Wow.  I wrote that a long time ago!
What I see now that I didn't make clear was that when I introduced the variables $a,b$ the where not supposed to be integers.  They were just supposed to be so that $ab = M > 0;a>0;b>0$.
What I wanted to prove was the concept that $a+b$ will be least when $a$ and $b$ are close together and largest when $a$ and $b$ are far apart.  (Indeed the very least $a$ and $b$ can be is $2\sqrt{M}$ when $a = b = \sqrt M$.)
(The idea was that if $a+b$ is always smallest when $a$ and $b$ are closest together then to find the integers with the least sum would be a matter of finding the pair of complementary factors that are closest together.  However to prove my concept, restricting to integers would not be relevant.)
However in order to prove my concept the variables so that $a\cdot b = M$ were not the best ones to prove $a+b$ is least when $a$ and $b$ are close.  A better choice of variables would be an $r> 0$ where $(\sqrt M\cdot r)(\frac {\sqrt M}r) = M$ and we would need to prove that $(M\cdot r)+(\frac{\sqrt M}r)$ is least when $r$ and $\frac 1r$ are each closest to $1$.
So...
Now it should be clear that for any $M > 0$ we can find $a,b$ so that $ab =M$ (just let $a> 0$ be anything and let $b =\frac Mb$).  And it should be clear we can always find an $r$ so that $(\sqrt M r)(\frac {\sqrt M}r)=M$ (just let $r$ be anything positive).  And it should be clear that for any pair of $a,b$ (integers or not) we can convert to $r$ by letting $r = \frac a{\sqrt M}$. And for any $r> 0$ we con convert to $a,b$ by letting $a =\sqrt M\cdot r$ and $b=\frac {\sqrt M}r$.
However for any $r$ we have absolutely no reason to believe those  $a $ and $b$ will be integers.
So the answer to your question is: No.  $a$ and $b$ will only be integers for some values of $r$.  If $M$ is an integer there will always be some $r$ where they are both integers, but for any $r$ in general, the resulting $a,b$ will not be integers.
....
When I finished proving that the closer $r$ is to $1$ then the smaller $(\sqrt Mr) + (\frac {\sqrt M}r)$, I completed the argument by noting to find the integers $a,b$ so that $ab=M$ and $a+b$ is the least possible value, we need to find the integer factor pairs of $M$ that are closest together.
