Computing a best-fit quadratic approximation to a given function over a finite interval I have a function of the form $$f(b) = \frac{1}{2}(\sqrt{N-b^2}-b+1) $$ on the interval $1\leq b < \sqrt{N/2}$. When I plot this curve for various values of $N$, I get a parabolic shape ($ax^2+bx+c$) whose coefficients I can determine by curve fitting using MATLAB for individual values of $N$. The approximate coefficients I get for this parabola are $$a\approx-\sqrt{0.1/N} , \qquad b\approx -0.47 , \qquad \textrm{and} \qquad c\approx \sqrt{N}/2 .$$ I would like to know if there is a proper way to arrive at these parameters or any other parabolic shape without resorting to empirical curve fitting? In other words, is there a way to express $f(b)$ as a parabola?
P.S: I tried the normal way of using $f(1)$ and $f(\sqrt{N/2})$ and deriving the coefficients $a$,$b$ and $c$, but the issue is that there is a large error term for large $N$. It would be nice to know any better method.
Thanks in advance!
 A: Which quadratic approximation $x \mapsto A x^2 + B x + C$ best fits the function $f(x)$ over the interval $[1, \sqrt{N / 2}]$ depends on your definition of "best", but a canonical choice is the quadratic whose difference from $f(x)$ has the minimal norm in $L^2([0, \sqrt{N / 2}])$. By definition the square of this norm is
$$M  := \int_1^{\sqrt{N / 2}} [f(x) - (A x^2 + B x + C)]^2 dx .$$
The integral is elementary, so this is straightforward (but tedious) to evaluate manually. The result, which is too long to typeset, is nonetheless simple in the way that matters for our purpose: It is a quadratic polynomial in $A, B, C$. (The dependence on $N$ is more complicated, but that's irrelevant to the next step.)
Our problem is now to find parameters $A, B, C$ that minimize this quantity $M$, but this is a standard exercise in multivariable calculus: We compute and classify the critical points---the  solutions $(A, B, C)$ to $\frac{\partial M}{\partial A} = \frac{\partial M}{\partial B} = \frac{\partial M}{\partial C} = 0$. Because $M$ is a nondegenerate quadratic in $A, B, C$, these conditions comprise a nondegenerate linear system in $A, B, C$, which means there is a unique solution, and this critical point turns out to be a minimum.
Linearity of the system also means that we can write this unique solution for $A, B, C$ as functions of $N$, but these are really complicated, and again typesetting them would be laborious (and the result not very illuminating). That said, we can produce good (and brief) asymptotic approximations for these quantities for large $N$. Expanding in series at $N = +\infty$ gives
$$
A = \frac{A_0}{\sqrt{N}} + O\left(\frac{1}{N}\right), \qquad
B = B_0 + O\left(\frac{1}{\sqrt{N}}\right), \qquad
C = C_0 \sqrt{N} + O(1) ,
$$
---and in particular retaining the leading term of each expansion gives a canonical quadratic approximation,
$$\color{#df0000}{\boxed{f(x) \approx \frac{A_0}{\sqrt{N}} x^2 + B_0 x + C_0 \sqrt{N}}} .$$
---where
$$\color{#df0000}{\boxed{
\begin{align}
A_0 &= - 120 + \frac{75}{2} \sqrt{2} + 15 \pi \sqrt{2}  = -0.32374\ldots \\
B_0 &= - \frac{83}{2} + 64 \sqrt{2} - \frac{63}{4} \pi = -0.47041\ldots \\
C_0 &= - 12 + \frac{33}{8} \sqrt{2} + \frac{3}{2} \pi \sqrt{2} = 0.49795\ldots
\end{align}
}}$$
These values agree closely with the manually estimated values given in the question.
Some graphical evidence shows that this is indeed a good approximation for large $N$ but is an underestimate for small $N$. One can improve the estimate, of course, by keeping more terms from the series approximation. For example, also retaining the constant term of the expansion for $C$, $\frac{299}{4} - \frac{225}{2} \sqrt{2} + 27 \pi \approx 0.47397\ldots$, dramatically improves the approximation for small $N$.
