I'm trying to solve some equations using extended precision arithmetics, and I don't have inverse trigonometric functions to simply calculate cos(arccos(cos(x))3). I do have (real) square / cube roots and powers.
I think that if I wanted cos(3x) from sin(x) and cos(x), this could be solved using Euler formula and binomial expansion easily.
However, since I want cos(x3) from sin(x) and cos(x) (the third angle instead of three angles), I think this will ultimately lead to solving a cubic equation. Is that so, or is there a simpler way how to calculate it?
Answer
If your program can do complex cube-roots, then (cosx+isinx)1/3=cos(x/3)+isin(x/3)
Unfortunately, the standard, Cardano solution to the cubic involves complex cube-roots whenever the three solutions are real. And they are real because they are cos(x/3),cos((x+2π)/3),cos((x−2π)/3).
Otherwise, you could do Newton's Method to find the answer as precisely as you want.
I see you tagged it precalculus, so here is Newton's Method:
If y=cos(x/3), then 4y3−3y=cosx.
f(y)=4y3−3y−cosxg(y)=12y2−3y0= anything, say y0=0y1=y0−f(y0)/g(y0)y2=y1−f(y1)/g(y1)y3=y2−f(y2)/g(y2)
and continue until yn settles down. Which it should settle down pretty quickly
No comments:
Post a Comment