Cosine relation with polynomial

2.4k Views Asked by At

Can anybody tell me how can we write cosine fucntion iterms of a polynomial? May be there exist some relations that can approximate a cosine function with an equivalent polynomial of some degree of x.

3

There are 3 best solutions below

0
On BEST ANSWER

You are looking for the Taylor series of a function which relates a function to an infinte polynomial.

The Taylor series of $\cos(x)$ at $a=0$ ;

$\cos(x) = 1-\frac{x^2}{2!}+\frac{x^4}{4!} -\frac{x^6}{6!}+\frac{x^8}{8!}-\cdots$

This is found by calculating the derivatives of $\cos(x)$ at $x=0$ and applying the formula of the taylor series gives as an expansion of;

$f(x) = \sum_{n=0}^\infty f^n(a)\frac{(x-a)^n}{n!}$

where $f^n$ is the $n^{th}$ derivative of $f$

0
On

Could you possibly mean the Taylor Series of cosine? Which comes out to be: $\sum_{n=1}^{\infty} (-1)^n\frac{x^{2n}}{2n!}$

Expanded, it looks like: $1-\frac{x^2}{2!}+\frac{x^4}{4!}-\frac{x^6}{6!}+\frac{x^8}{8!}-...$

0
On

You can approximate the cosine by means of a polynomial in a certain range in the least-squares sense by minimizing

$$E=\int_a^b\left(\sum_n p_nx^n-\cos x\right)^2 dx.$$

To achieve the minimum, you cancel the gradient, by

$$\frac{\partial E}{\partial p_m}=\int_a^bx^m\left(\sum_n p_nx^n-\cos x\right)dx=0$$

or, after expansion,

$$\sum_np_n{\frac{(b^{n+m+1}-a^{n+m+1})}{n+m+1}}=\int_a^bx^m\cos x\,dx.$$

After evaluation of the RHS integrals, you get a linear system of equations to be solved for the $p_n$.


You can also obtain approximations in the minmax sense (largest pointwise absolute error as small as possible) by means of the Chebychev theory and the Remez algorithm, but this is more involved.


Note that it is advantageous to exploit the periodicity and symmetries of the trigonometric functions and approximate sine and cosine over $[0,\pi/4]$.