# What are some algorithms used to find square root(or to approximate them)? Say sqrt(2), sqrt(7)

For example, for $\sqrt{7}$, you could note that this number is a root of the function $f \left(x\right) = {x}^{2} - 7$. Newton's Method is an iterative scheme based on the equation ${x}_{n + 1} = {x}_{n} - \setminus \frac{f \left({x}_{n}\right)}{f ' \left({x}_{n}\right)} = {x}_{n} - \setminus \frac{{x}_{n}^{2} - 7}{2 {x}_{n}}$ (the derivation of this is based on finding the $x$-intercept of the tangent line to the graph of $f$ at the point $\left({x}_{n} , f \left({x}_{n}\right)\right)$). Based on the initial guess ${x}_{0} = 3$, we would get ${x}_{1} = 3 - \setminus \frac{9 - 7}{6} = 3 - \setminus \frac{1}{3} = \setminus \frac{8}{3} \setminus \approx 2.66667$ as our next approximation (if you square this number, you'll get $\setminus \frac{64}{9} \setminus \approx 7.11111$).
If you use Newton's Method one more time here, you'll get ${x}_{2} = \setminus \frac{8}{3} - \setminus \frac{\frac{64}{9} - 7}{\frac{16}{3}} = \setminus \frac{8}{3} - \setminus \frac{\frac{1}{9}}{\frac{16}{3}} = \setminus \frac{8}{3} - \setminus \frac{1}{48} = \setminus \frac{127}{48} \setminus \approx 2.64583333$, which is very close to $\setminus \sqrt{7}$.
In the general case where you want to approximate $\setminus \sqrt{c}$ for some $c > 0$, the recursive equation from Newton's Method simplifies to ${x}_{n + 1} = \setminus \frac{{x}_{n}^{2} + c}{2 {x}_{n}}$ (based on the function $f \left(x\right) = {x}^{2} - c$). Pick ${x}_{0}$ to be an integer such that ${\left({x}_{0} - 1\right)}^{2} < c \setminus \le q {x}_{0}^{2}$ and already the number ${x}_{1}$ from Newton's Method will be pretty close to $\setminus \sqrt{c}$.