ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 26 Nov 2023 14:01:11 +0100Expand cos(2*pi/n) for n=5, 17, 257, 65537 to Radicals (Fermat prime numbers)https://ask.sagemath.org/question/74492/expand-cos2pin-for-n5-17-257-65537-to-radicals-fermat-prime-numbers/I want to expand $\cos\left( \dfrac{2\pi}{n} \right)$ for $n=5,~17,~ 257, 65537$ to radicals, for example:
$\cos\left( \dfrac{2\pi}{5} \right) =\frac14 \sqrt{5} -\frac14$
BTW: These $n$ are *Fermat prime numbers*, see [Exact trigonometric values](https://en.wikipedia.org/wiki/Exact_trigonometric_values).
Is this a possible task?
x = var('x')
test = (x+1)^2 # test
test.expand() # works :)
term = cos(2*pi/5)
term.expand() # works :)
term = cos(2*pi/17)
term.expand() # works not :(
PS: I tried
cos(2*pi/17).trig_simplify()
cos(2*pi/17).trig_expand()
as well.geroyxSun, 26 Nov 2023 14:01:11 +0100https://ask.sagemath.org/question/74492/Another problem simplifying symbolic trigonometric expressionshttps://ask.sagemath.org/question/40561/another-problem-simplifying-symbolic-trigonometric-expressions/ I am testing Sage with the notebook interface, and I want to simplify this trigonometric symbolic expression:
var('x1','x2')
exp1=sin(x1)*cos(x2)+sin(x2)*cos(x1)
print(exp1.trig_simplify())
Sage does not simplify this expression and the result is:
cos(x2)*sin(x1) + cos(x1)*sin(x2)
As you can see the result show be:
sin(x1+x2)
Is there any to simplify trigonometric functions applied to the addition or the subtraction of two values?
ThanksceiarThu, 11 Jan 2018 10:40:29 +0100https://ask.sagemath.org/question/40561/Problem with trig_simplify()https://ask.sagemath.org/question/40271/problem-with-trig_simplify/I am testing Sage with basic simbolic expressions appliying derivatives to some functions f(t).
When I try to simplify the trigonometric final expressiÃ³n Sage Notebook does not recognize the partial derivative symbol.
I do not understand the new variable psi(t) that appears in the solution.
Here is the Notebook Sage code:
var('t,alpha,beta,gamma');
alpha(t)=function('alpha',t); beta(t)=function('beta',t); gamma(t)=function('gamma',t);
mi(t)=sin(beta)^2*diff(alpha(t), t) + (cos(beta)*diff(alpha(t), t) +diff(gamma(t), t))*cos(beta);
print(mi(t).expand());
print(mi(t).expand().trig_simplify());
Here is the result:
cos(beta(t))^2*diff(alpha(t), t) + sin(beta(t))^2*diff(alpha(t), t) +
cos(beta(t))*diff(gamma(t), t)
cos(beta(t))*gamma(t)*psi(t) + diff(alpha(t), t)
ceiarThu, 21 Dec 2017 18:52:35 +0100https://ask.sagemath.org/question/40271/