kill(all)$

van=facebook.com/LearningCalculus$

f(x):=1-(cos(x)+(cos(2*x))^2+(cos(2*x))^3)$
g(a,x):=a-(tan(x)+(tan(x))^2+(tan(x))^3)$
u(a,x):=f(x)-g(a,x)$

newtonF(t):=float(subst(t,x,x-f(x)/diff(f(x),x)))$

x1:newtonF(6.015973960972446388b-1);
x2:%pi;
x3:newtonF(newtonF(2*%pi-x1));

f(x1);
f(x2);
f(x3);

a3:0$
u(a3,x3);
g(a3,x);

a2:g(a3,x);
u(a2,x2);
g(a2,x);

a1:g(a2,x);
u(a1,x1);
g(a1,x);

[x1,g(a,x1)];

[x2,g(a,x2)];

[x3,g(a,x3)];