What's said in the box is not clear. The author meant to say,
If A working alone takes a days more than A and B together, and B working alone takes b days more than A and B together, then the number of days taken by A and B working together is given by $\sqrt{ab}$.
Also, I think that the result of the provided example should be 6 hours and not 6 days because $a$ and $b$ are given in hours.
I'd like to know where $\sqrt{ab}$ comes from. So far, It's the only formula I haven't been able to derive myself.

Let A and B together = $x$ days
A alone = $a + x$ days
B alone = $b + x$ days
Per day work of A + Per day work of B = per day work of A + B
$\frac{1}{a+x} + \frac{1}{b+x} = \frac{1}{x}$
We get $(a + b + 2x)x = (a+x)(b+x) \implies x^2 = ab$