2

I just saw a post on instagram which said that

$$\sqrt{x}\approx \frac{x+y}{2\sqrt{y}}$$

I tried it out on a few values, and surprisingly, it came within 1 decimal point of the actual answer. Is there a reason for this or is it coincidental?

y is the closest perfect square to x

prata
  • 215

4 Answers4

4

This is because, for $x\approx y$:

$$\sqrt{xy}\approx \frac{x+y}{2}$$

This is a consequence of the AM-GM Inequality, which states that:

$$\frac{x+y}{2}\geq\sqrt{xy}$$

For all $x, y\geq 0$, with equality occurring if and only if $x=y$.

Joshua Wang
  • 6,103
  • so does this means that it'll only work for relatively small values, and the bigger the number, the more inaccurate the answer will be? – prata Mar 04 '21 at 15:19
2

Using Taylor series around $y=x$ (assuming them to be positive), we have $$\sqrt{x\,y}=x+\frac{y-x}{2}-\frac{(y-x)^2}{8 x}+\frac{(y-x)^3}{16 x^2}+O\left((y-x)^4\right)$$ and,sice it is an alternating series, you can build a lot of ineaqualities.

1

Google AM–GM inequality.

If we square any real number $z$, which can be expressed as a difference of two other real numbers $x$ and $y$, the result is always greater or equal $0$, this means $\color{blue}{z^2 \geq 0}$, assume $z = x-y$, it follows $$\color{blue}{z^2} = (x-y)^2 = x^2 \color{red}{-2xy} + y^2 = x^2 \color{red}{+ 2xy} + y^2 \color{red}{- 4xy} =(x+y)^2-4xy\color{blue}{\geq 0} $$

$$\Rightarrow (x+y)^2-4xy\geq 0 \Leftrightarrow(x+y)^2\geq 4xy \Rightarrow x+y \geq \sqrt{4xy} \Leftrightarrow \frac{x+y}{2\sqrt{y}} \geq \sqrt{x}$$

The result is:

$$\sqrt{x} \leq \frac{x+y}{2\sqrt{y}} $$

If $x = y$, then

$$\sqrt{x} =\frac{x+y}{2\sqrt{y}} $$

Example: $$\sqrt{4} =\frac{4+4}{2\sqrt{4}} = 2$$

Ahmed Hossam
  • 1,151
0

Your approximation is for lower disadvantages, there's a better approximation for the Square root function, check here for it's derivation $$\sqrt{x} \approx \frac{ x+k^2+k}{2k+1}$$ Say $k^2+k = y$, $k^2+k-y = 0$ $$k = \frac{ -1 \pm \sqrt{1+4y} }{2}$$ $$\sqrt{x} = \approx \frac{x+y}{2k+1}$$ $$2k+1 = \sqrt{1+4y}$$ $$2k+1 = 2\sqrt{y+\frac{1}{4}}$$ $$2k+1 \approx 2\sqrt{y}$$ $$\sqrt{x} = \approx \frac{ x+y}{2\sqrt{y}}$$