Can anyone explain me what is this equation telling us? I need to implement it in my computer program.
I do not need a proof of these, but an explanation of notation used here. $$ \sin x = \sum^{\infty}_{n=0} \frac{(-1)^n}{(2n+1)!} x^{2n+1} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots\quad\text{ for all } x\!$$
AND
$$ \cos x = \sum^{\infty}_{n=0} \frac{(-1)^n}{(2n)!} x^{2n} = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots\quad\text{ for all } x\! $$
First let's deal with the "!" thing. Mathematicians use this to denote the "factorial" of a number $n$, which means $n$ times $n-1$ times $n-2$ ... times 3 times 2 times 1. So, for example, $3! = 3 \times 2 \times 1 = 6$, and $5! = 5 \times 4 \times 3 \times 2 \times 1 = 120$. You can calculate factorials using a recursive function like the following one (written in C#):
Next, the $\sum$ notation. This is just a shorthand way of writing a "summation", which is the addition of a bunch of terms. So, the second equation says that you can calculate $\cos(x)$ by adding up a large number of terms that each have the form $$ \frac{(-1)^n}{(2n)!}x^{2n} $$ The C# code to calculate one of these terms (for given $x$ and $n$) is
So, the code to add up the first $n$ terms is
According to the formula, this CosineSum function should give the same values as the cosine function, if $n$ is large enough. Larger values of $n$ will give better answers.
Of course, all of this is just theory. In practice, if you were writing code in C# (or any other reasonable language) you would just use the built-in cos function.
And, if you really needed to calculate $\cos(x)$ yourself, then there are other approaches that work much better than the series expansion technique we used here. For example, see here.