## Task 15/66

For the calculation of the square root of a number $z=p^{2}+a$ with $0 \leq a \leq 2 p+1$, the approximation formula is

$$
\sqrt{z}=\sqrt{p^{2}+a} \approx p+\frac{a}{2 p+1}
$$

How large is the maximum error of this approximation in dependence on $a$? How does this change in dependence on $p$?
Let $\sqrt{z}=\sqrt{p^{2}+a}=p+\frac{a}{2 p+1}+\epsilon$, thus

$$
\epsilon=f_{1}(a)=\sqrt{p^{2}+a}-\frac{a}{p+1}-p
$$

(with $p=$ constant). From this, it follows that

$$
\epsilon^{\prime}=f_{1}^{\prime}(a)=\frac{2}{\sqrt{p^{2}+a}}-\frac{1}{2 p+1}
$$

$$
\epsilon^{\prime \prime}=f_{1}^{\prime \prime}(a)=-\frac{1}{4\left(p^{2}+a\right) \sqrt{p^{2}+a}}<0
$$

(for any $a \geq 0$). Therefore, the solution to the equation $\epsilon^{\prime}=0$ provides the maxima. It results in $a=p+\frac{1}{4}$ and thus $\epsilon_{\max }=\frac{1}{4(2 p+1)}=f_{2}(p)$.

One can see that $\epsilon_{\max }$ approaches zero as $p$ increases, it is

$$
\lim _{p \rightarrow \infty} \epsilon_{\max }=\lim _{p \rightarrow \infty} \frac{1}{4(2 p+1)}=0
$$

As can be easily seen, $\epsilon$ has minima at the boundaries of the domain interval $\epsilon_{\min _{1}}=0$ for $a=0$ and $\epsilon_{\text {min }_{2}}=0$ for $a=2 p+1$.