\documentclass[english, a4paper, 12pt, reqno]{amsart}% article ams
\usepackage[english]{babel}% support for English typography
\usepackage[T1]{fontenc}% T1 font encoding, new LaTeX standard
\usepackage{lmodern}% Latin Modern font (vector)
\usepackage[left=1.8cm,right=2.2cm,top=2.5cm,bottom=2.5cm]{geometry}% page margins
\def\emailaddrname{Email address }
\def\urladdrname{Website }

\usepackage{siunitx}% replaces siunit
\sisetup{
    locale = DE,% comma as decimal separator (to keep French-style numbers)
    output-decimal-marker={,},
    group-minimum-digits = 3,
    group-separator={~},
    quantity-product={~},
    inter-unit-product={~}
}

\usepackage{pst-all}% for drawing
\usepackage{float}% begin figure[H] (does not work with subfigure, keep [h!])

\usepackage{empheq}% highlight important formulas
\definecolor{mygrey}{rgb}{.9, .9, .9}
\newcommand*\greybox[1]{\colorbox{mygrey}{\hspace{1em}#1\hspace{1em}}}

\usepackage{titlesec}% title formatting
\titleformat{\section}[block]{\vspace{\baselineskip}\large\scshape}{\thesection}{.7cm}{}[\hrule\vspace{.75\baselineskip}]
\titleformat{\subsection}[block]{\vspace{.75\baselineskip}\bfseries}{\thesubsection}{.5cm}{}[]
\renewcommand{\numberline}[1]{#1~~}% Fix ToC numbering

\usepackage{fancyhdr}% page numbering
\fancyhf{}% clear header and footer
\pagestyle{fancy}
\fancyhead[LE,RO]{\bfseries\thepage}% page number position
\renewcommand{\headrulewidth}{0pt}% no header rule
\setlength{\headheight}{16pt}% fix \headheight too small error

\newtheorem{remarque}{Remark}[section]
\newenvironment{rmq}{\begin{remarque}\footnotesize}{\end{remarque}}

\usepackage{hyperref}% configure PDF reader opening
\hypersetup{
    pdftoolbar=true,
    pdfmenubar=true,
    pdftitle={Square Roots and Nth Roots},
    pdfauthor={Olivier Castéra},
    pdfstartview= FitH,
    colorlinks=true,
    linkcolor=blue,
    }

\title{Square Roots and Nth Roots}
\author{Olivier Castéra}
\email{o.castera@free.fr}
\urladdr{https://sciences-physiques.neocities.org}
\date{\today}

\begin{document}
\begin{abstract}
Demonstration of Heron's sequence for calculating square roots using elementary operations of addition,
subtraction, multiplication, and division. Then generalization of the method to nth roots.
\end{abstract}
\maketitle
\thispagestyle{empty}
\tableofcontents

\section{Numerical Example}
We need to calculate $\sqrt{10}$. The calculator gives $\sqrt{10}=\num{3,16227766}\dots$ To start the sequence, we need an initial value.
We choose $3$ in this example because $\sqrt{10}$ is close to $3$,
but Heron's sequence converges regardless of the choice of initial value.
A first approximation of $\sqrt{10}$ is given by the following calculation:
\begin{align*}
\dfrac{1}{2}\left(3+\dfrac{10}{3}\right)=\num{3,1666666}\dots
\end{align*}
To obtain more exact decimal places, we repeat the process.
Note that it is unnecessary to keep all decimals in intermediate calculations:
\begin{align*}
\dfrac{1}{2}\left(3,17+\dfrac{10}{3,17}\right)\approx\num{3,16228707}\dots
\end{align*}

\section{Proof of Heron's Sequence}
The method used for calculating $\sqrt{10}$ is a sequence written as:
\begin{empheq}[box=\greybox]{align*}
B_{n}=\dfrac{1}{2}\left(B_{n-1}+\dfrac{A}{B_{n-1}}\right)
\end{empheq}
in which $A=10$ and $B_0=3$. Then we calculated:
\begin{align*}
B_1&=\dfrac{1}{2}\left(B_0+\dfrac{A}{B_0}\right)=\num{3,1666666}\dots\\
B_2&=\dfrac{1}{2}\left(B_1+\dfrac{A}{B_1}\right)\approx\num{3,16228707}\dots
\end{align*}
In what follows, parameters will be denoted in uppercase ($A$ and $B$), while variables will be denoted in lowercase ($x$ and $y$).

\medskip
Let $A$ be a number whose root $B$ we seek, then:
\begin{align*}
B&=\sqrt A\\
B^{2}&=A\\
B&=\dfrac{A}{B}
\end{align*}
To solve this equation, vary $x$ until it is a solution to $x=A/x$.
When $x$ is a solution to the equation, it will have the value $B$. Therefore, if we plot the curves $y=x$ and $y=A/x$,
they will intersect at $x=B$.

\begin{figure}[H]
\psset{unit=1 cm, labels=none}%units for x and y.
%\psset{unit=1 cm,algebraic=true} to no longer use reverse Polish notation
%\psset{xunit=2cm,yunit=1cm} for different units
\begin{pspicture}(-2,-1)(10,9)%reserved area for the image
%\psgrid(-2,-1)(10,9)
\psaxes{->}(0,0)(-1.5,-1.5)(8.5,8)
\psset{dotstyle=+}
\pcline{->}(0,0)(1,0)\rput(0.5,-0.4){$\vec i$}%unit vector i
\pcline{->}(0,0)(0,1)\rput(-0.5,0.5){$\vec j$}
\def\F{x}%Definition of f: y=x
\def\G{10 x div}
\psplot[linecolor=blue,linewidth=1.5pt]{-1}{7}{\F}%plot F from x=-1 to x=7
\rput[l](1.7,7.5){$y=\dfrac{A}{x}$}
\psplot[linecolor=red,linewidth=1.5pt]{1.35}{8}{\G}
\rput[l](7.4,7.2){$y=x$}
\rput[l](-0.2,8.4){$Y$}
\rput[l](9,0){$X$}
\rput[l](3,-0.5){$B=\sqrt A$}
\psline[linestyle=dashed](3.1622,0)(3.1622,3.1622)
\end{pspicture}
\end{figure}

Let us see what happens if we use the sequence $B_{n}=A/B_{n-1}$ by fixing the initial value at $B_0$,
with $B_0$ arbitrary and preferably close to $\sqrt A$. Once $B_0$ is fixed, we graphically find $B_1=A/B_0$,
then $B_2=A/B_1$.

\psset{unit=0.5 cm, labels=none}
\begin{figure}[H]
\begin{pspicture}(0,8.5)(24,-16)%aire reservee a  l'image
\psaxes{->}(0,0)(-1.5,-1.5)(8.5,8.5)
\psset{dotstyle=+}
\def\F{x}%Definition de f : y=x
\def\G{10 x div}
\psplot[linecolor=blue,linewidth=1.5pt]{-1}{7}{\F}%tracer F de x=-1 a  x=8
\psplot[linecolor=red,linewidth=1.5pt]{1.4}{8}{\G}
\rput[l](7.4,7.2){$y=x$}
\rput[l](1.5,8){$y=\frac{A}{x}$}
\rput[l](-.1,9){$Y$}
\rput[l](9,0){$X$}
\rput[l](4.5,-1){$B_0$}
\rput[l](-3,2){$y=\frac{A}{B_0}$}
\psline[linestyle=dashed, arrowscale=2]{->}(5,0)(5,2)(0,2)
\rput(16,0){
\psaxes{->}(0,0)(-1.5,-1.5)(8.5,8.5)
\psset{dotstyle=+}
\def\F{x}%Definition de f : y=x
\def\G{10 x div}
\psplot[linecolor=blue,linewidth=1.5pt]{-1}{7}{\F}%tracer F de x=-1 a  x=8
\psplot[linecolor=red,linewidth=1.5pt]{1.4}{8}{\G}
\rput[l](7.4,7.2){$y=x$}
\rput[l](1.5,8){$y=\frac{A}{x}$}
\rput[l](-.1,9){$Y$}
\rput[l](9,0){$X$}
\rput[l](1.5,-1){$x=\frac{A}{B_0}=B_1$}
\rput[l](-1.5,2){$\frac{A}{B_0}$}
\psline[linestyle=dashed, arrowscale=2]{->}(0,2)(2,2)(2,0)}
\rput(0,-14){
\psaxes{->}(0,0)(-1.5,-1.5)(8.5,8.5)
\psset{dotstyle=+}
\def\F{x}%Definition de f : y=x
\def\G{10 x div}
\psplot[linecolor=blue,linewidth=1.5pt]{-1}{7}{\F}%tracer F de x=-1 a  x=8
\psplot[linecolor=red,linewidth=1.5pt]{1.4}{8}{\G}
\rput[l](7.4,7.2){$y=x$}
\rput[l](1.5,8){$y=\frac{A}{x}$}
\rput[l](-.1,9){$Y$}
\rput[l](9,0){$X$}
\rput[l](1.5,-1){$B_1$}
\rput[l](-3,5){$y=\frac{A}{B_1}$}
\psline[linestyle=dashed, arrowscale=2]{->}(2,0)(2,5)(0,5)}
\rput(16,-14){
\psaxes{->}(0,0)(-1.5,-1.5)(8.5,8.5)
\psset{dotstyle=+}
\def\F{x}%Definition de f : y=x
\def\G{10 x div}
\psplot[linecolor=blue,linewidth=1.5pt]{-1}{7}{\F}%tracer F de x=-1 a  x=8
\psplot[linecolor=red,linewidth=1.5pt]{1.4}{8}{\G}
\rput[l](7.4,7.2){$y=x$}
\rput[l](1.5,8){$y=\frac{A}{x}$}
\rput[l](-.1,9){$Y$}
\rput[l](9,0){$X$}
\rput[l](4.5,-1){$x=B_2$}
\rput[l](-1.5,5){$\frac{A}{B_1}$}
\psline[linestyle=dashed, arrowscale=2]{->}(0,5)(5,5)(5,0)}
\end{pspicture}
\end{figure}

We observe that $B_2=B_0$, which we can easily verify:
\begin{align*}
B_2=\frac{A}{B_1}=\frac{A}{A/B_0}=B_0
\end{align*}
This result shows that the sequence $B_{n}=A/B_{n-1}$ does not converge to $\sqrt A$.
To make $x$ tend toward $\sqrt A$, graphically, we need to approach the intersection of the two curves
(here one of the curves is a line, but the solving method is used generally with two curves).

\medskip
Let us rewrite the initial equation as follows:
\begin{align*}
B&=\frac{A}{B}\\
B+B&=\frac{A}{B}+B\\
2B&=\frac{A}{B}+B\\
B&=\frac{1}{2}\left(\frac{A}{B}+B\right)
\end{align*}
We plot $y=x$ and $y=\frac{1}{2}\left(\frac{A}{B}+B\right)$. They intersect at $x=B$.

\begin{figure}[H]
\psset{unit=0.6 cm, labels=none}%units for x and y.
\begin{pspicture}(0,-2)(6,10)%reserved area for the image
%\psgrid(0,-2)(6,10)
\psaxes[ticks=none]{->}(0,0)(-1.5,-1.5)(8.5,8.5)%ticks=none to remove ticks
\psset{dotstyle=+}
\pcline{->}(0,0)(1,0)\rput(0.5,-0.4){$\vec i$}%unit vector i
\pcline{->}(0,0)(0,1)\rput(-0.5,0.5){$\vec j$}
\def\F{x}%Definition of f: y=x
\def\G{10 x div x add 2 div}
\psplot[linecolor=blue,linewidth=1.5pt]{-1}{7}{\F}%plot F from x=-1 to x=7
\rput[l](0.5,6){$y=\frac{1}{2}\left(\frac{A}{B}+B\right)$}
\psplot[linecolor=red,linewidth=1.5pt]{1}{8}{\G}
\rput[l](7.4,7.2){$y=x$}
\rput[l](-.1,9){$Y$}
\rput[l](9,0){$X$}
\rput[l](3,-0.5){$B=\sqrt A$}
\psline[linestyle=dashed](3.1622,0)(3.1622,3.1622)
\end{pspicture}
\end{figure}

How does the new sequence $B_{n}=\frac{1}{2}\left(B_{n-1}+\frac{A}{B_{n-1}}\right)$ behave:

\begin{figure}[H]
\psset{unit=0.6 cm, labels=none}%units for x and y.
\begin{pspicture}(0,-2)(6,10)%reserved area for the image
%\psgrid(0,-2)(6,10)
\psaxes[ticks=none]{->}(0,0)(-1.5,-1.5)(8.5,8.5)
\psset{dotstyle=+}
\pcline{->}(0,0)(1,0)\rput(0.5,-0.4){$\vec i$}%unit vector i
\pcline{->}(0,0)(0,1)\rput(-0.5,0.5){$\vec j$}
\def\F{x}%Definition of f: y=x
\def\G{10 x div x add 2 div}
\psplot[linecolor=blue,linewidth=1.5pt]{-1}{7}{\F}%plot F from x=-1 to x=7
\rput[l](0.5,6){$y=\frac{1}{2}\left(\frac{A}{B}+B\right)$}
\psplot[linecolor=red,linewidth=1.5pt]{1}{8}{\G}
\rput[l](7.4,7.2){$y=x$}
\rput[l](-.1,9){$Y$}
\rput[l](9,0){$X$}
\rput[l](3,-0.5){$B$}
\rput[l](6.8,-0.6){$B_0$}
\rput[l](4.014,-0.6){$B_1$}
\psline[linestyle=dashed](7,0)(7,4.214)(4.214,4.214)(4.214,3.294)(3.294,3.294)(3.294,3.165)
\end{pspicture}
\end{figure}

It converges quickly to $x=\sqrt A$.
By examining the diagram above, we understand that the convergence condition of the sequence is that the curve
$y=\frac{1}{2}\left(\frac{A}{x}+x\right)$ is minimal at $\sqrt A$.
In fact, it suffices for it to be extremal at this point, whether a maximum or a minimum.

\medskip
Let us verify that $\sqrt A$ is indeed an extremum of $y(x)=\frac{1}{2}\left(\frac{A}{x}+x\right)$
\begin{align*}
y'(x)&=\frac{1}{2}\left(1-\frac{A}{x^{2}}\right)\\
\frac{1}{2}\left(1-\frac{A}{x^{2}}\right)&=0\\
\frac{A}{x^{2}}&=1\\
A&=x^{2}\\
x&=\pm\sqrt A
\end{align*}
$\sqrt A$ is therefore indeed an extremum of $y(x)=\frac{1}{2}\left(\frac{A}{x}+x\right)$.

\section{Generalization to Nth Roots}
\begin{align*}
B^{n}&=A\\
B\times B^{n-1}&=A\\
B&=\frac{A}{B^{n-1}}\\
B+(n-1)B&=\frac{A}{B^{n-1}}+(n-1)B\\
nB&=\frac{A}{B^{n-1}}+(n-1)B\\
B&=\dfrac{1}{n}\left[ \frac{A}{B^{n-1}}+(n-1)B\right]
\end{align*}
whence the sequence
\begin{empheq}[box=\greybox]{align*}
B_{m}=\dfrac{1}{n}\left[\left(n-1\right)B_{m-1}+\dfrac{A}{B_{m-1}^{n-1}}\right]
\end{empheq}

\medskip
Let us verify that $\sqrt[n]A$ is an extremum of $y(x)=\dfrac{1}{n}\left[\left(n-1\right)x+\dfrac{A}{x^{n-1}}\right]$
\begin{align*}
y'(x)&=\frac{1}{n}\left[(n-1)-(n-1)Ax^{-n}\right]\\
\frac{n-1}{n}\left(1-Ax^{-n}\right)&=0\\
Ax^{-n}&=1\\
A&=x^{n}\\
x&=\pm\ \sqrt[n]A
\end{align*}
$\sqrt[n]A$ is therefore indeed an extremum of $y(x)=\dfrac{1}{n}\left[\left(n-1\right)x+\dfrac{A}{x^{n-1}}\right]$.

\begin{rmq}
In the case where $A$ is negative, $n$ must be odd, and we keep only the negative sign in the previous relation.
For example, for $A=-27$, we have $3=-\sqrt[3]{-27}$.
\end{rmq}

\newpage
\section{Numerical Example}
We need to calculate $\sqrt[5]7$. In this example, $A=7$, $n=5$, and we choose $B_0=1$.
\begin{align*}
B_0&=1\\
B_1&=\dfrac{1}{5}\left[4\times 1+\dfrac{7}{1^{4}}\right]=\dfrac{11}{5}=\num{2,2}\\
B_2&=\dfrac{1}{5}\left[4\times \num{2,2}+\dfrac{7}{\num{2,2}^{4}}\right] =\num{1,81976367}\dots\\
B_{3}&=\dfrac{1}{5}\left[4\times \num{1,82}+\dfrac{7}{\num{1,82}^{4}}\right] =\num{1,58359759}\dots\\
B_{4}&=\dfrac{1}{5}\left[4\times \num{1,58}+\dfrac{7}{\num{1,58}^{4}}\right] =\num{1,48864651}\dots\\
B_{5}&=\dfrac{1}{5}\left[4\times \num{1,49}+\dfrac{7}{\num{1,49}^{4}}\right] =\num{1,47604226}\dots
\end{align*}
The calculator gives $\sqrt[5]7=\num{1,475773161}\dots$\\
%\begin{thebibliography}{9}
%\end{thebibliography}
\end{document}
