Not sure if this question is in the right forum but here goes...
I currently trying to write some computer code to generate Sine(x).
I have found a site explaining the Taylor series approximation method.
sin(x) = x - (x^3)/3! + (x^5)/5! - (x^7)/7! + ...
Keep in mind that x is in radians and not in degrees!
Also, notice that it is not practical to compute x^3, x^5, x^7,... Instead, re-write the Taylor series in a nested form
sin(x) = x*(1 - (x^2)/3! + (x^4)/5! - (x^6)/7! + ...)
sin(x) = x*(1 - (x^2)*(1/3! - (x^2)/5! + (x^4)/7! -) ...)
Or, dropping the higher order terms
sin(x) ~ x*(1 - (x^2)*(1/3! - (x^2)(1/5! - (x^2)/7! )))
Finally, the factorial terms may be factored:
sin(x) ~ x*(1 - (x^2)*(1 - (x^2)(1 - (x^2)/(6*7) ) / (4*5) ) /(2*3) )
Ok so i used the last factored out formula (Above) to then extrapolate a series of multiplies, devides and subtractions to derrive the answer.
Unfortunatly 3 terms in this series is not enough to give the required accuracy
and from what i have read i need at least 6 so the new longer formula is
sin(x) = x -(x^3)/3! + (x^5)/5! - (x^7)/7! +(x^9)/9! -(x^11)/11!+(x^13)/13!
My problem is how do i factor this out the same as they did above. I am ok at doing equasions but hopless at algerbra. I simply canot figure how they got
sin(x) ~ x*(1 - (x^2)*(1 - (x^2)(1 - (x^2)/(6*7) ) / (4*5) ) /(2*3) )[/
sin(x) = x - (x^3)/3! + (x^5)/5! - (x^7)/7!
It took me a while to realise the signifigance of the ! in the equasion but even with this i still can't work it out.
I guess i would like someone to do it for me but if you can explain it as well that would be great!!