How are the Taylor Series derived? I know the Taylor Series are infinite sums that represent some functions like $\sin(x)$. But it has always made me wonder how they were derived? How is something like $$\sin(x)=\sum\limits_{n=0}^\infty \dfrac{x^{2n+1}}{(2n+1)!}\cdot(-1)^n = x-\dfrac{x^3}{3!}+\dfrac{x^5}{5!}-\dfrac{x^7}{7!}\pm\dots$$ derived, and how are they used? Thanks in advance for your answer.

This simple derivation of the Taylor series of a function is taken from lecture 37 of the MIT course Single Variable Calculus. More specifically, this derivation is taken from these lecture notes. A similar derivation can also be found here.
Given an infinitely differentiable function $f(x)$, we want to represent it as the power series
$$
f(x) = a_0 + a_1(x - c) + a_2(x-c)^2 + a_3(x-c)^3 + a_4(x-c)^4 + a_5(x-c)^5 + \cdots
$$
The goal is to determine the coefficients $a_0,a_1,a_2,\dots$. The general strategy for doing this is substituting $x=c$ into $f(x)$ and its derivatives and picking out the coefficients. For example,
$$
f(c) = a_0
$$
and so we know that $a_0$ has the value $f(c)$. Next, we can differentiate $f(x)$ to get
$$
f'(x) = a_1 + 2 \cdot a_2(x-c) + 3 \cdot a_3(x-c)^2 + 4 \cdot a_4(x-c)^3 + 5 \cdot a_5(x-c)^4 + \cdots
$$
Note that
$$
f'(c) = a_1
$$
We can then differentiate $f'(x)$ to get
$$
f''(x) = 2 \cdot a_2 + 3 \cdot 2 \cdot a_3(x-c) + 4 \cdot 3 \cdot a_4(x-c)^2 + 5 \cdot 4 \cdot a_5(x-c)^3 + \cdots
$$
Note that
$$
f''(c) = 2 \cdot a_2
$$
or
$$
a_2 = \frac{f''(c)}{2}
$$
We can repeat this process several times to get
\begin{align}
f'''(x) &= 3 \cdot 2 \cdot a_3 + 4 \cdot 3 \cdot 2 \cdot a_4(x-c) + 5 \cdot 4 \cdot 3 \cdot a_5(x-c)^2 + \cdots \\
f''''(x) &= 4 \cdot 3 \cdot 2 \cdot a_4 + 5 \cdot 4 \cdot 3 \cdot 2 \cdot a_5(x-c) + \cdots \\
\end{align}
and we can substitute $x = c$ into these derivatives to get
\begin{align}
f'''(c) &= 3 \cdot 2 \cdot a_3 \\
f''''(c) &= 4 \cdot 3 \cdot 2 \cdot a_4
\end{align}
re-arranging, we get
\begin{align}
a_3 &= \frac{f'''(c)}{3 \cdot 2} \\
a_4 &= \frac{f''''(c)}{4 \cdot 3 \cdot 2}
\end{align}
Therefore, the general pattern is
\begin{align}
a_0 &= f(c) = \frac{f(c)}{0!} \\
a_1 &= f'(c) = \frac{f'(c)}{1!} \\
a_2 &= \frac{f''(c)}{2} = \frac{f''(c)}{2!} \\
a_3 &= \frac{f'''(c)}{3 \cdot 2} = \frac{f'''(c)}{3!} \\
a_4 &= \frac{f''''(c)}{4 \cdot 3 \cdot 2} = \frac{f''''(c)}{4!} \\
&\vdots \\
a_n &= \frac{f^{(n)}(c)}{n!}
\end{align}
So, the power series representation of $f(x)$ is
\begin{align}
f(x) &= \frac{f(c)}{0!} + \frac{f'(c)}{1!}(x - c) + \frac{f''(c)}{2!}(x-c)^2 + \frac{f'''(c)}{3!}(x-c)^3 + \cdots \\
&= \sum_{n=0}^\infty \frac{f^{(n)}(c)}{n!} (x-c)^n
\end{align}
