next up previous
Next: About this document ...

A Polynomial Approximation of the Sine Function



Before we state the problem, consider $ C[a,b]$, the vector space of all real-valued continuous functions on the interval $ [a,b]$. Define the inner product $ \langle,\rangle:C[a,b]\mapsto\mathbb{R}$ as

$\displaystyle \langle\bar{p},\bar{q}\rangle=\displaystyle \int^{b}_{a}p(t)q(t)\;dt$

This makes $ C[a,b]$ an inner-product space with the following properties:

(i)
For any function $ \bar{p}\in C[a,b]$ we define $ \vert\vert\bar{p}\vert\vert^2=\displaystyle \int^{b}_{a}[p(t)]^2\;dt$.

(ii)
For any $ \bar{p},\bar{q}\in C[a,b]$ we define $ \vert\vert\bar{p}-\bar{q}\vert\vert^2\displaystyle \int^{b}_{a}\big[p(t)-q(t)\big]^2\;dt$.

(iii)
Two functions $ \bar{p},\bar{q}\in C[a,b]$ are orthogonal iff $ \displaystyle \int^{b}_{a}p(t)q(t)\;dt=0$.

The Problem: Suppose we want to find a $ 5^{th}$ degree polynomial approximation for the function $ \sin(t)$ on the interval $ [-\pi,\pi]$. That is, we want to find a quintic polynomial such that for every value $ t\in[-\pi,\pi]$,

$\displaystyle \sin(t)\approx a_0+a_1t+a_2t^2+a_3t^3+a_4t^4+a_5t^5$

In calculus we learned how to build a $ 5^{th}$ degree Taylor polynomial approximation, centered at $ a=0$, for the function $ \sin(t)$ as

$\displaystyle \sin(t)\approx t-\displaystyle \frac{t^3}{3!}+\displaystyle \frac{t^5}{5!}$

Unfortunately, when we look at the following graphs of this Taylor polynomial and $ \sin(t)$ we see that the approximation is very poor near the endpoints of the interval.

\includegraphics[scale=1.0]{sinxtaylornolabel.eps}
The graphs of $ \sin(t)$ and $ t-\displaystyle \frac{t^3}{3!}+\displaystyle \frac{t^5}{5!}$.

Can we find a better approximation for $ \sin(t)$ on this interval without increasing the degree of the polynomial?

To answer this question we now consider the inner-product space $ C[-\pi,\pi]$, with inner product defined as above, and observe that $ W=span\{1,t,t^2,t^3,t^4,t^5\}$ is a subspace of $ C[-\pi,\pi]$. Furthermore, every polynomial with degree $ \le 5$ is in $ W$, and so we ask which polynomial in $ W$ is ``closest'' to $ \sin(t)$, relative to the inner-product and norms defined for $ C[-\pi,\pi]$. Finding this polynomial is equivalent to finding the orthogonal projection of $ \sin(t)$ onto the subspace $ W$. The following diagram might help in understanding this idea.

\includegraphics[scale=0.4]{projection.eps}

Before we state the necessary theorems to construct orthogonal projections, we note that given a vector space $ V$ equipped with any inner product, then if $ \v\in V$ is a vector not in a subspace $ W$, the closest point to $ \v $ in $ W$, with respect the inner product defined, is always the orthogonal projection of $ \v $ onto $ W$.

Theorem 1   Let $ V$ be a vector space, and suppose that $ \{\u _1,\u _2,\dots,\u _p\}$ is an orthogonal basis for a subspace $ W$ of $ V$. Then for every $ \v\in V$, the orthogonal projection of $ \v $ onto $ W$ (which, relative to the inner product defined, is the vector in $ W$ that is closest to $ \v $) is calculated as

$\displaystyle proj_{_W}\v =c_1\u _1+c_2\u _2+\cdots+c_p\u _p,$

where for $ i=1,\dots,p$,

$\displaystyle c_i=\displaystyle \frac{\langle\v ,\u _i\rangle}{\langle\u _i,\u _i\rangle}$

So before we find an orthogonal projection onto $ W$, we need to find an orthogonal basis for $ W$. This can be found using the Gram-Schmidt process, which is stated in the following theorem.

Theorem 2   Let $ \{\bar{x}_1,\bar{x}_2,\dots,\bar{x}_p\}$ be a basis for a subspace $ W$, and define
$\displaystyle \v _1$ $\displaystyle =$ $\displaystyle \bar{x}_1$  
$\displaystyle \v _2$ $\displaystyle =$ $\displaystyle \bar{x}_2-\displaystyle \frac{\langle\bar{x}_2,\v _1\rangle}{\langle\v _1,\v _1\rangle}\;\v _1$  
$\displaystyle \v _3$ $\displaystyle =$ $\displaystyle \bar{x}_3-\displaystyle \frac{\langle\bar{x}_3,\v _2\rangle}{\lan...
...laystyle \frac{\langle\bar{x}_3,\v _1\rangle}{\langle\v _1,\v _1\rangle}\;\v _1$  
    $\displaystyle \vdots$  
$\displaystyle \v _p$ $\displaystyle =$ $\displaystyle \bar{x}_p-\displaystyle \frac{\langle\bar{x}_p,\v _{p-1}\rangle}
...
...laystyle \frac{\langle\bar{x}_p,\v _1\rangle}{\langle\v _1,\v _1\rangle}\;\v _1$  

Then $ \{\v _1,\v _2,\dots,\v _p\}$ is an orthogonal basis for $ W$ relative to the given inner product.

For our problem, we use the Gram-Schmidt process on the basis $ \{1,t,t^2,t^3,t^4,t^5\}$ with the inner product

$\displaystyle \langle\bar{p},\bar{q}\rangle=\displaystyle \int^{\pi}_{-\pi}p(t)q(t)\;dt$

The process goes as follows:


$\displaystyle \v _1$ $\displaystyle =$ $\displaystyle 1$  
$\displaystyle \v _2$ $\displaystyle =$ $\displaystyle t-\displaystyle \frac{\langle t,1\rangle}{\langle1,1\rangle}1$  

Then computing these inner products we get
$\displaystyle \langle t,1\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t\cdot1\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t\;dt$  
  $\displaystyle =$ 0  
       
$\displaystyle \langle 1,1\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}1\cdot1\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}\;dt$  
  $\displaystyle =$ $\displaystyle 2\pi$  

So we have
$\displaystyle \v _1$ $\displaystyle =$ $\displaystyle 1$  
$\displaystyle \v _2$ $\displaystyle =$ $\displaystyle t-\displaystyle \frac{\langle t,1\rangle}{\langle1,1\rangle}1$  
  $\displaystyle =$ $\displaystyle t-\displaystyle \frac{0}{2\pi}\cdot1$  
  $\displaystyle =$ $\displaystyle t$  

Next we compute $ \v _3$.


$\displaystyle \v _3$ $\displaystyle =$ $\displaystyle t^2-\displaystyle \frac{\langle t^2,t\rangle}{\langle t,t\rangle}t-
\displaystyle \frac{\langle t^2,1\rangle}{\langle1,1\rangle}1$  

Computing the inner products we get


$\displaystyle \langle t^2,1\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^2\cdot1\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^2\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \frac{2\pi^3}{3}$  
       
$\displaystyle \langle t^2,t\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^2\cdot t\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^3\;dt$  
  $\displaystyle =$ 0  
       
$\displaystyle \langle t,t\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t\cdot t\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^2\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \frac{2\pi^3}{3}$  

And we get


$\displaystyle \v _1$ $\displaystyle =$ $\displaystyle 1$  
$\displaystyle \v _2$ $\displaystyle =$ $\displaystyle t$  
$\displaystyle \v _3$ $\displaystyle =$ $\displaystyle t^2-\displaystyle \frac{\langle t^2,t\rangle}{\langle t,t\rangle}t-
\displaystyle \frac{\langle t^2,1\rangle}{\langle1,1\rangle}1$  
  $\displaystyle =$ $\displaystyle t^2-\displaystyle \frac{0}{2\pi^3/3}\cdot t-\displaystyle \frac{2\pi^3/3}{2\pi}\cdot1$  
  $\displaystyle =$ $\displaystyle t^2-\displaystyle \frac{\pi^2}{3}$  

Next we compute $ \v _4$.

$\displaystyle \v _4=t^3-
\displaystyle \frac{\langle t^3,t^2-\pi^2/3\rangle} {...
...le t,t\rangle}t-
\displaystyle \frac{\langle t^3,1\rangle}{\langle1,1\rangle}1$

Now computing inner products we get


$\displaystyle \langle t^3,t\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^3\cdot t\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^4\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \frac{2\pi^5}{5}$  
       
$\displaystyle \langle t^3,1\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^3\cdot1\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^3\;dt$  
  $\displaystyle =$ 0  
       
$\displaystyle \langle t^3,t^2-\pi^2/3\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^3\cdot(t^2-\pi^2/3)\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}(t^5-t^3\pi^2/3)\;dt$  
  $\displaystyle =$ 0  
       
$\displaystyle \langle t^2-\pi^2/3,t^2-\pi^2/3\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}[t^2-\pi^2/3]^2\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \frac{8\pi^5}{45}$  

So we get


$\displaystyle \v _4$ $\displaystyle =$ $\displaystyle t^3-
\displaystyle \frac{\langle t^3,t^2-\pi^2/3\rangle} {\langle...
...gle t,t\rangle}t-
\displaystyle \frac{\langle t^3,1\rangle}{\langle1,1\rangle}1$  
  $\displaystyle =$ $\displaystyle t^3-
\displaystyle \frac{0}{8\pi^5/45}(t^2-\pi^2/3)-
\displaystyle \frac{2\pi^5/5}{2\pi^3/3}\cdot t-
\displaystyle \frac{0}{2\pi}\cdot1$  
  $\displaystyle =$ $\displaystyle t^3-\displaystyle \frac{3\pi^2t}{5}$  

We now have


$\displaystyle \v _1$ $\displaystyle =$ $\displaystyle 1$  
$\displaystyle \v _2$ $\displaystyle =$ $\displaystyle t$  
$\displaystyle \v _3$ $\displaystyle =$ $\displaystyle t^2-\displaystyle \frac{\pi^2}{3}$  
$\displaystyle \v _4$ $\displaystyle =$ $\displaystyle t^3-\displaystyle \frac{3\pi^2}{5}t$  

Now we compute $ \v _5$.


$\displaystyle \v _5$ $\displaystyle =$ $\displaystyle t^4- \displaystyle \frac{\langle t^4,t^3-3\pi^2t/5 \rangle}{\lang...
...e t^4,t^2-\pi^2/3\rangle}{\langle
t^2-\pi^2/3,t^2-\pi^2/3 \rangle}(t^2-\pi^2/3)$  
       
    $\displaystyle -\displaystyle \frac{\langle t^4,t\rangle}{\langle t,t\rangle}t-
\displaystyle \frac{\langle t^4,1 \rangle}{\langle1,1\rangle}1$  

Computing inner products we get


$\displaystyle \langle t^4,t\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^4\cdot t\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^5\;dt$  
  $\displaystyle =$ 0  


$\displaystyle \langle t^4,1\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^4\cdot 1\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^4\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \frac{2\pi^5}{5}$  
       
$\displaystyle \langle t^4,t^2-\pi^2/3\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^4\cdot(t^2-\pi^2/3)\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^6-t^4\pi^2/3\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \frac{16\pi^7}{105}$  
       
$\displaystyle \langle t^4,t^3-3\pi^2t/5\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^4\cdot(t^3-3/\pi^2t/5)\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^7-3\pi^2t^5/5\;dt$  
  $\displaystyle =$ 0  
       
$\displaystyle \langle t^3-3\pi^2t/5,t^3-3\pi^2t/5\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}[t^3-3\pi^2t/5]^2\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \frac{8\pi^7}{175}$  

So we get


$\displaystyle \v _5$ $\displaystyle =$ $\displaystyle t^4- \displaystyle \frac{\langle t^4,t^3-3\pi^2t/5 \rangle}{\lang...
...e t^4,t^2-\pi^2/3\rangle}{\langle
t^2-\pi^2/3,t^2-\pi^2/3 \rangle}(t^2-\pi^2/3)$  
    $\displaystyle -\displaystyle \frac{\langle t^4,t\rangle}{\langle t,t\rangle}t-
\displaystyle \frac{\langle t^4,1 \rangle}{\langle1,1\rangle}1$  
  $\displaystyle =$ $\displaystyle t^4-\displaystyle \frac{0}{8\pi^7/175}(t^3-3\pi^2t/5)-
\displayst...
...splaystyle \frac{0}{2\pi^3/3}\cdot t-
\displaystyle \frac{2\pi^5/5}{2\pi}\cdot1$  
  $\displaystyle =$ $\displaystyle t^4-\displaystyle \frac{90\pi^2}{105}(t^2-\pi^2/3)-\displaystyle \frac{\pi^4}{5}$  

We now have


$\displaystyle \v _1$ $\displaystyle =$ $\displaystyle 1$  
$\displaystyle \v _2$ $\displaystyle =$ $\displaystyle t$  
$\displaystyle \v _3$ $\displaystyle =$ $\displaystyle t^2-\displaystyle \frac{\pi^2}{3}$  
$\displaystyle \v _4$ $\displaystyle =$ $\displaystyle t^3-\displaystyle \frac{3\pi^2}{5}t$  
$\displaystyle \v _5$ $\displaystyle =$ $\displaystyle t^4-\displaystyle \frac{6\pi^2t^2}{7}-\displaystyle \frac{3\pi^4}{35}$  

We now compute $ \v _6$.


$\displaystyle \v _6$ $\displaystyle =$ $\displaystyle t^5-\displaystyle \frac{\langle t^5,t^4-6\pi^2t^2/7-3\pi^4/35 \ra...
...ft(t^4-\displaystyle \frac{6\pi^2t^2}{7}-\displaystyle \frac{3\pi^4}{35}\right)$  
       
    $\displaystyle -\displaystyle \frac{\langle t^5,t^3-3\pi^2t/5\rangle} {\langle
t...
...e t^5,t^2-\pi^2/3\rangle}
{\langle t^2-\pi^2/3,t^2-\pi^2/3\rangle}(t^2-\pi^2/3)$  
       
    $\displaystyle -\displaystyle \frac{\langle t^5,t\rangle}{\langle t,t\rangle}t-
\displaystyle \frac{\langle t^5,1\rangle}{\langle1,1\rangle}1$  

Computing inner products we get


$\displaystyle \langle t^5,1\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^5\cdot1\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^5\;dt$  
  $\displaystyle =$ 0  
       
$\displaystyle \langle t^5,t\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^5\cdot t\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^6\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \frac{2\pi^7}{7}$  
       
$\displaystyle \langle t^5,t^2-\pi^2/3\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^5(t^2-\pi^2/3)\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^7-\pi^2t^5/3)\;dt$  
  $\displaystyle =$ 0  
       
$\displaystyle \langle t^5,t^3-3\pi^2t/5\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^5(t^3-3\pi^2t/5)\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \frac{16\pi^9}{315}$  
       
$\displaystyle \langle t^5,t^4-6\pi^2t^2/7-3\pi^4/35\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^5(t^4-6\pi^2t^2/7-3\pi^4/35)\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}t^9-6\pi^2t^7/7-3\pi^4t^5/35\;dt$  
  $\displaystyle =$ 0  


$\displaystyle \langle t^4-6\pi^2t^2/7-3\pi^4/35,t^4-6\pi^2t^2/7-3\pi^4/35\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}[t^4-6\pi^2t^2/7-3\pi^4/35]^2\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \frac{776\pi^9}{11025}$  

So we get


$\displaystyle \v _6$ $\displaystyle =$ $\displaystyle t^5-\displaystyle \frac{0}{776\pi^9/11025}
\left(t^4-\displaystyl...
...3\pi^4}{35}\right)-
\displaystyle \frac{16\pi^9/315}{8\pi^7/175}(t^3-3\pi^2t/5)$  
       
    $\displaystyle -\displaystyle \frac{0}{8\pi^5/45}(t^2-\pi^2/3)-\displaystyle \frac{2\pi^7/7}{2\pi^3/3}\cdot t-
\displaystyle \frac{0}{2\pi}\cdot1$  

Simplifying we now have the following orthogonal basis for $ W$.


$\displaystyle \v _1$ $\displaystyle =$ $\displaystyle 1$  
$\displaystyle \v _2$ $\displaystyle =$ $\displaystyle t$  
$\displaystyle \v _3$ $\displaystyle =$ $\displaystyle t^2-\displaystyle \frac{\pi^2}{3}$  
$\displaystyle \v _4$ $\displaystyle =$ $\displaystyle t^3-\displaystyle \frac{3\pi^2}{5}t$  
$\displaystyle \v _5$ $\displaystyle =$ $\displaystyle t^4-\displaystyle \frac{6\pi^2t^2}{7}-\displaystyle \frac{3\pi^4}{35}$  
$\displaystyle \v _6$ $\displaystyle =$ $\displaystyle t^5-\displaystyle \frac{10\pi^2}{9}t^3+\displaystyle \frac{5\pi^4}{21}t$  

It is now time to project $ \sin(x)$ onto the subspace $ W$.

Using Theorem 1 we get


$\displaystyle \sin(t)$ $\displaystyle =$ $\displaystyle \displaystyle \frac{\langle\sin(t),1\rangle}{\langle1,1\rangle}\c...
...i^2/3\rangle}
{\langle t^2-\pi^2/3,t^2-\pi^2/3 \rangle}\left(t^2-\pi^2/3\right)$  
       
    $\displaystyle +\displaystyle \frac{\langle\sin(t),t^3-3\pi^2t/5\rangle}
{\langle t^3-3\pi^2t/5,t^3-3\pi^2t/5
\rangle}\left(t^3-3\pi^2t/5\right)$  
       
    $\displaystyle +\displaystyle \frac{\langle\sin(t), t^4-6\pi^2t^2/7-3\pi^4/35\ra...
...^4/35,t^4-6\pi^2t^2/7-3\pi^4/35 \rangle}
\left(t^4-6\pi^2t^2/7-3\pi^4/35\right)$  
       
    $\displaystyle +\displaystyle \frac{\langle\sin(t),t^5-10\pi^2t^3/9+5\pi^4t/21\r...
...1,t^5-10\pi^2t^3/9+5\pi^4t/21
\rangle}
\left(t^5-10\pi^2t^3/9+5\pi^4t/21\right)$  

We compute the following inner products.


$\displaystyle \langle\sin(t),1\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}\sin(t)\cdot1\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}\sin(t)\;dt$  
  $\displaystyle =$ 0  
       
$\displaystyle \langle\sin(t),t\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}\sin(t)\cdot t\;dt$  
  $\displaystyle =$ $\displaystyle 2\pi$  
       
$\displaystyle \langle\sin(t),t^2-\pi^2/3\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}\sin(t)\cdot(t^2-\pi^2/3)\;dt$  
  $\displaystyle =$ 0  
       
$\displaystyle \langle\sin(t),t^3-3\pi^2t/5\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}\sin(t)\cdot(t^3-3\pi^2t/5)\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \frac{4\pi(\pi^2-15)}{5}$  


$\displaystyle \langle\sin(t),t^4-6\pi^2t^2/7-3\pi^4/35\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}\sin(t)\cdot(t^4-6\pi^2t^2/7-3\pi^4/35)\;dt$  
  $\displaystyle =$ 0  
       
$\displaystyle \langle\sin(t),t^5-10\pi^2t^3/9+5\pi^4t/21\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}\sin(t)\cdot(t^5-10\pi^2t^3/9+5\pi^4t/21)\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \frac{16\pi\left(\pi^4-105\pi^2+945\right)}{63}$  
       
$\displaystyle \langle t^5-10\pi^2t^3/9+5\pi^4t/21,t^5-10\pi^2t^3/9+5\pi^4t/21\rangle$ $\displaystyle =$ $\displaystyle \displaystyle \int^{\pi}_{-\pi}(t^5-10\pi^2t^3/9+5\pi^4t/21)^2\;dt$  
  $\displaystyle =$ $\displaystyle \displaystyle \frac{128\pi^{11}}{43659}$  

So now we have


$\displaystyle proj_{_W}[\sin(t)]$ $\displaystyle =$ $\displaystyle \displaystyle \frac{0}{2\pi}\cdot1+
\displaystyle \frac{2\pi}{2\pi^3/3}\cdot t+
\displaystyle \frac{0}{8\pi^5/45}\left(t^2-\pi^2/3\right)$  
       
    $\displaystyle +\displaystyle \frac{4\pi(\pi^2-15)/5}{8\pi^7/175}
\left(t^3-3\pi^2t/5\right)$  
       
    $\displaystyle +\displaystyle \frac{0}{776\pi^9/11025}\left(t^4-6\pi^2t^2/7-3\pi^4/35\right)$  
       
    $\displaystyle +\displaystyle \frac{16\pi\left(\pi^4-105\pi^2+945\right)/63}
{128\pi^{11}/43659}
\left(t^5-10\pi^2t^3/9+5\pi^4t/21\right)$  
  $\displaystyle =$ $\displaystyle \displaystyle \frac{2\pi}{2\pi^3/3}\cdot t+\displaystyle \frac{4\pi(\pi^2-15)/5}{8\pi^7/175}
\left(t^3-3\pi^2t/5\right)$  
       
    $\displaystyle +\displaystyle \frac{16\pi\left(\pi^4-105\pi^2+945\right)/63}
{128\pi^{11}/43659}
\left(t^5-10\pi^2t^3/9+5\pi^4t/21\right)$  

Using a calculator to simplify this we get

$\displaystyle proj_{_W}\sin(t)\approx 0.987862t-0.155271t^3+0.00564312t^5$

If we now look at the graph of this orthogonal projection compared to $ \sin(x)$ we see that our approximation is very good on the entire interval.

\includegraphics[scale=1.0]{sinxprojnolabel.eps}
The graphs of $ \sin(t)$ and $ 0.987862t-0.155271t^3+0.00564312t^5$.


In fact, relative to this inner product we can do no better. In other words, this is the best $ 5^{th}$ degree polynomial approximation of $ \sin(t)$ on the interval $ [-\pi,\pi]$. If we want to improve our approximation we would have to raise the degree of the approximating polynomial.

Fortunately, many mathematics computer programs, such as Mathematica, have built in functions that perform the Gram-Schmidt process and the orthogonal projections. Once we have removed the tedious hand computations from the process, we have found a superior method to approximate continuous functions with polynomials.




next up previous
Next: About this document ...
Robert Rostermundt 2004-12-02