2
$\begingroup$

I've been given the following function (reciprocal of 2nd order polynomial): $$f(x) = \frac{1}{ax^2+bx+c}$$ and an interval $I=[x_0, x_1]$.

I need to find a 3rd order polynomial $g(x)=a^\prime x^3+b^\prime x^2 + c^\prime x + d^\prime$ that best approximates $f$ on $I$ using least squared error.

Coefficients $a$, $b$, $c$ and interval bounds $x_0$, $x_1$ are given, so a numerical solution would be sufficient. However, I have many instances of the problem with different parameters, so an analytical solution that is easier to execute many times would be better.

The problem arises from two different physical models of a resistor value dependant on temperature. One manufacturer gives me $f(x)$, the other expects $g(x)$.

New contributor
Quaristice is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$
11
  • $\begingroup$ Welcome to MSE. Please read this text about how to ask a good question. $\endgroup$ Commented yesterday
  • $\begingroup$ Demanding a least squares solution sounds like overkill. You could just calculate 4 equally spaced points on your interval and calculate the cubic that fits them. $\endgroup$ Commented yesterday
  • $\begingroup$ @SimonGoater You mean I should just evaluate $f(x)$ four times and generate the unique polynomial from that? Would evaluating it N times, say N=500, be a relevant improvement? I would then need to solve a system of linear equations. $\endgroup$ Commented yesterday
  • 2
    $\begingroup$ See e.g. doi.org/10.1016/j.cam.2005.10.013 $\endgroup$ Commented yesterday
  • $\begingroup$ @R.J.Mathar. I knew and enjoyed this interesting paper. $\endgroup$ Commented yesterday

1 Answer 1

4
$\begingroup$

Let $$f(x) = \frac{1}{ax^2+bx+c}\qquad \text{and} \qquad g(x)=\sum_{n=0}^3 \alpha_n \,x^n$$ and, as suggested in comment, consider the problem of the minimization of the infinite norm $$\Phi=\int_{x_0}^{x_1}\Big(f(x)-g(x)\Big)^2 \,dx$$ The integration is not difficult is you start writing $$f(x)=\frac 1{a(x-r_1)(x-r_2)}=\frac 1{a(r_1-r_2)}\Big(\frac 1{x-r_1}-\frac 1{x-r_2} \Big)$$ which means that you face simple integrals (the result will be a very few logarithms and arc tangents).

When done, compute the four partial derivatives and set them equal to zero. The result is a linear system of four equations for four unknowns whose solutions are analytic.

Edit

For the fun of it, I used $a=2$, $b=3$, $c=5$, $x_0=2$ and $x_1=4$.

Making the coefficients rational $$g(x)=\frac{61}{377}-\frac{43}{502}x+\frac{6}{325}x^2-\frac{1}{679}x^3$$

For these values $\Phi=1.533\times 10^{-9}$ and the maximum error is $9.325\times 10^{-5}$ at the lower bound.

$\endgroup$
4
  • $\begingroup$ Nice answer, +1. I'm just not sure what you mean by infinite norm. This would be a squared $L^2$ norm, if it exists. $\endgroup$ Commented yesterday
  • 1
    $\begingroup$ @PierreCarre. Thank you. This is the $L^2$ norm. At my time, in France, we did not use this term and I am out od date ! Cheers :-) $\endgroup$ Commented yesterday
  • $\begingroup$ Thanks for your answer. What are $r_1$ and $r_2$? Are these auxiliary variables that I can later express in terms of $b$ and $c$? $\endgroup$ Commented 1 hour ago
  • $\begingroup$ @Quaristice. $r_1$ and $r_2$ are the roots of $ax^2+bx+c=0$ $\endgroup$ Commented 32 mins ago

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.