system
Given the following post, respond as if you're commenting on Reddit:
human
Are there polynomial equations that are equal to basic trig functions?

Are there polynomial functions that are equal to basic trig functions (i.e: y=cos(x), y=sin(x))? If so what are they and how are they calculated? Also are there any limits on them (i.e only works when a<x<b)?
gpt
It's possible to express these functions as Taylor series, which are sums of polynomial terms of increasing power, getting more and more accurate.

(working in radians here)

For the sine function, it's sin(x)~=x-x^3 /6 + x^5 /120 - x^7 /5040... Each term is an odd power, divided by the factorial of the power, alternating positive and negative.

For cosine it's even powers instead of odd: cos(x)~=1-x^2 /2 +x^4 /24 ...

With a few terms, these are pretty accurate over the normal range that they are calculated for (0 to 360 degrees or x=0 to 2pi). However, with a finite number of terms they are never completely accurate. The smaller x is, the more accurate the series approximation is.

You can also fit a range of these functions to a polynomial of arbitrary order, which is what calculators use to calculate values efficiently (more efficient than Taylor series).