So, I am writing a C++ program that sum the series expansion of sin(x). But for large values of x my program fails.
$\sin(x)=x-(x^3/3!)+(x^5/5!)-...=$$\sum_{n=0}^n (-1)^n\frac{x^{2n+1}}{(2n+1)!}$
I don't understand, how can we say that the sum converge for all x?
If $\lim_{x\to \infty}$ then the terms in the series blows up towards infinity and the sum diverges. What is it that I don't understand?
Check the Lagrange Remainder of your Taylor series $$R_n = \frac {f^{(n+1)}(\alpha) x^{n+1}}{(n+1)!}$$
Since you have ${(n+1)!}$ dominating $x^{n+1}$, the remainder will approach zero and your series converge.
You can also look at the series as an alternating series whose terms are approaching zero, so it converges.
For larger $x$ values you need more terms to get good approximation.