Example of computations with trigonometric constants Consider the problem: Let We can solve it by noting that involved numbers can be expressed in terms of roots of fricas (1) -> cyclotomic(36)$CyclotomicUtilities
Type: SparseUnivariatePolynomial?(Integer)
fricas )set output algebra on fricas )set output tex off Type: Type
fricas )set output tex on fricas )set output algebra off Now, we can express all ingredients in terms of generator: fricas et := (generator()$cF)^10
Type: SimpleAlgebraicExtension?(Fraction(Integer),
fricas ct := (et + 1/et)/2
Type: SimpleAlgebraicExtension?(Fraction(Integer),
fricas st := (et - 1/et)/(2*(generator()$cF)^9)
Type: SimpleAlgebraicExtension?(Fraction(Integer),
and our expression is: fricas ex := (4*ct + 1)*st/ct
Type: SimpleAlgebraicExtension?(Fraction(Integer),
Now we can find minimal polynomial and find its roots: fricas minimalPolynomial(%)
Type: SparseUnivariatePolynomial?(Fraction(Integer))
and we see that the result is We could also observe that the expression above is a member of smaller cyclotomic field and from
that infer expression Now we need root of fricas cyclotomic(28)$CyclotomicUtilities
Type: SparseUnivariatePolynomial?(Integer)
fricas )set output algebra on fricas )set output tex off Type: Type
fricas )set output tex on fricas )set output algebra off Root of degree fricas im2 := generator()$cF2^7
Type: SimpleAlgebraicExtension?(Fraction(Integer),
fricas e1 := generator()$cF2^2
Type: SimpleAlgebraicExtension?(Fraction(Integer),
We express trigonometric functions in terms of this fricas c1 := (e1 + 1/e1)/2
Type: SimpleAlgebraicExtension?(Fraction(Integer),
fricas e2 := e1^2
Type: SimpleAlgebraicExtension?(Fraction(Integer),
fricas c2 := (e2 + 1/e2)/2
Type: SimpleAlgebraicExtension?(Fraction(Integer),
fricas s2 := (e2 - 1/e2)/(2*im2)
Type: SimpleAlgebraicExtension?(Fraction(Integer),
fricas e3 := e1^3
Type: SimpleAlgebraicExtension?(Fraction(Integer),
fricas c3 := (e3 + 1/e3)/2
Type: SimpleAlgebraicExtension?(Fraction(Integer),
fricas s3 := (e3 - 1/e3)/(2*im2)
Type: SimpleAlgebraicExtension?(Fraction(Integer),
fricas e4 := e1^4
Type: SimpleAlgebraicExtension?(Fraction(Integer),
fricas c4 := (e4 + 1/e4)/2
Type: SimpleAlgebraicExtension?(Fraction(Integer),
fricas s4 := (e4 - 1/e4)/(2*im2)
Type: SimpleAlgebraicExtension?(Fraction(Integer),
fricas e5 := e1^5
Type: SimpleAlgebraicExtension?(Fraction(Integer),
fricas c5 := (e5 + 1/e5)/2
Type: SimpleAlgebraicExtension?(Fraction(Integer),
fricas s5 := (e5 - 1/e5)/(2*im2)
Type: SimpleAlgebraicExtension?(Fraction(Integer),
Using this we can compute the expression: fricas im2*(5*s5 - 5*s4 + 5*s3 - 5*s2) - 5*c5 + 5*c4 - 5*c3 + 5*c2 - 10*c1 + 6
|

