The Taylor series of a real or complex-valued function \(f(x)\) that is infinitely differentiable at a real or complex number \(a\) is the power series
$$f(a)+{\frac {f'(a)}{1!}}(x-a)+{\frac {f''(a)}{2!}}(x-a)^{2}+{\frac {f'''(a)}{3!}}(x-a)^{3}+\cdots$$
which can be written in the more compact sigma notation as
$$\sum _{i=0}^{\infty }{\frac {f^{(i)}(a)}{i!}}\,(x-a)^{i}$$
where \(i!\) denotes the factorial of \(i\) and \(f^{(i)}(a)\) denotes the \(i\)th derivative of \(f\) evaluated at the point \(a\).
Partial Solution Strategy
We deonote
$$g_n = \sum _{i=0}^{n}{\frac {f^{(i)}(a)}{i!}}\,(x-a)^{i}$$
Then
$$g_{n+1} = \sum _{i=0}^{n+1}{\frac {f^{(i)}(a)}{i!}}\,(x-a)^{i}=\sum _{i=0}^{n}{\frac {f^{(i)}(a)}{i!}}\,(x-a)^{i}+{\frac {f^{(n+1)}(a)}{(n+1)!}}\,(x-a)^{n+1}$$which is$$g_{n+1} = g_n+{\frac {f^{(n+1)}(a)}{(n+1)!}}\,(x-a)^{n+1}$$Let \(n \rightarrow \infty\), we have$$\lim_{n\rightarrow\infty}g_n=\sum _{i=0}^{\infty }{\frac {f^{(i)}(a)}{i!}}\,(x-a)^{i}$$Hence, we can calculate the summation like usual. The only difference is that we will terminate the process when the \(n\)th term is less than some small quantity, such as \(10^{-6}\).Examples1, \(\sin x\) and \(\cos x\)$${\begin{aligned}\sin x&=x-{\frac {x^{3}}{3!}}+{\frac {x^{5}}{5!}}-{\frac {x^{7}}{7!}}+\cdots =\sum _{n=0}^{\infty }{\frac {(-1)^{n}x^{2n+1}}{(2n+1)!}},\\\cos x&=1-{\frac {x^{2}}{2!}}+{\frac {x^{4}}{4!}}-{\frac {x^{6}}{6!}}+\cdots =\sum _{n=0}^{\infty }{\frac {(-1)^{n}x^{2n}}{(2n)!}}.\end{aligned}}$$Note:
$$\begin{aligned}\sin \theta &=\sin \left(\theta +2\pi k\right)\,,\\\cos \theta &=\cos \left(\theta +2\pi k\right)\,,\end{aligned}$$