Approximating $\frac{1}{(1+x)^2}$ in $L^2$ norm with polynomial of degree $1$

69 Views Asked by At

I'm currently looking at an exercise where I'm supposed to get the best approximation of $ \frac{1}{1+x^2}$ regarding $ ||f||= \sqrt{\int_{-1}^{1}f(x)^2dx}$ with a polynomial $p(x)=ax+b$. So my idea was to use the normal equation alongside the first two legendre polynomials since they are orthonormal polynomials regarding the dot product without a weight and a basis of the polynomials up to degree 1. So as I understand it I therefore just have to calculate the dot products $ <f,u_1>, <f,u_2>$ and I get the best approximation. So my polynomial ended up being $p(x)=\frac{\sqrt{2}* \pi}{4}$. However, a) I'm not entirely sure whether this approach is correct and b) there was also a hint for the exercise where it listed various values of cos and sin between 0 and $ \pi $. The intention might be that this table is used to calculate the values -1 and 1 of arctan in order to calculate the first coefficient of the polynomial but to me that would just seem like an odd hint, so I was wondering whether there is an intended approach that makes use of these values.

1

There are 1 best solutions below

0
On

I believe you want to minimize the $L^2$ error defined by

$$\lVert e\rVert = \sqrt{\int_{-1}^{1}\left(\frac{1}{1+x^2}-(ax+b)\right)^2dx}$$

but this is equivalent to minimizing the $\lVert e\rVert ^2$ so we have

$$\lVert e\rVert ^2 = \int_{-1}^{1}\left(\frac{1}{1+x^2}\right)^2dx-2\int_{-1}^{1}\frac{ax+b}{x^2+1}dx+\int_{-1}^{1}(ax+b)^2dx$$

the first term $\int_{-1}^{1}\left(\frac{1}{1+x^2}\right)^2dx$ is not a function of $a,b$ so we need to calculate two integrals

$$\int_{-1}^{1}\frac{ax+b}{x^2+1}dx = \frac{a}{2}\ln(x^2+1)\rvert_{-1}^{1} + b\arctan(x)\rvert_{-1}^{1} = b\frac{\pi}{2}$$

$$\int_{-1}^{1}(ax+b)^2dx = (\frac{a^2x^3}{3} + abx^2+b^2x)\rvert_{-1}^{1} = \frac{2a^2}{3}+2b^2$$

Now taking the gradient of squared error $\lVert e\rVert ^2 = \frac{2a^2}{3}+2b^2 - b\pi$, as $\nabla \lVert e\rVert ^2 = \begin{bmatrix}\frac{4a}{3}\\4b-\pi\end{bmatrix}$ we get $\begin{bmatrix}a=0\\b=\frac{\pi}{4}\end{bmatrix}$ as the final solution.