Ask Your Question

ceiar's profile - activity

2022-05-23 04:26:08 +0200 received badge  Notable Question (source)
2022-05-23 04:26:08 +0200 received badge  Popular Question (source)
2022-04-23 16:29:30 +0200 received badge  Famous Question (source)
2021-04-21 10:32:04 +0200 received badge  Notable Question (source)
2021-04-21 10:32:04 +0200 received badge  Popular Question (source)
2018-01-11 10:40:29 +0200 asked a question 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? Thanks

2018-01-10 10:12:28 +0200 commented answer Problem with trig_simplify()

I did not know this way for define symbolic functions. Thanks

2017-12-28 18:09:25 +0200 commented question Problem with trig_simplify()

I am working with the last version recently compiled from the source code.

'SageMath version 8.1, Release Date: 2017-12-07'

2017-12-26 22:12:04 +0200 received badge  Student (source)
2017-12-23 12:16:12 +0200 commented question Problem with trig_simplify()

I did not want to use mathematical function gamma. I only wanted to define an angle variable. I have just used another name for the symbolic angle variable 'rho' and now it works.

Here it is the code:

var('t,alpha,beta,rho'); 
alpha(t)=function('alpha',t); beta(t)=function('beta',t); rho(t)=function('rho',t);
mi(t)=sin(beta)^2*diff(alpha(t), t) + (cos(beta)*diff(alpha(t), t) +diff(rho(t), t))*cos(beta); 
show(mi(t).expand());
show(mi(t).trig_simplify());

And the expected result:

cos(beta(t))^2*diff(alpha(t), t) + sin(beta(t))^2*diff(alpha(t), t) +
cos(beta(t))*diff(rho(t), t)
cos(beta(t))*diff(rho(t), t) + diff(alpha(t), t)

Thanks Nbruin

2017-12-22 09:22:14 +0200 commented question Problem with trig_simplify()

Notebook tells it is psi(t). But it is amazing!! It is not defined. And seems to susbtitute 'diff(gamma(t),t)' that it is supposed to be the right answer.

Right answer must be: cos(beta(t))*diff(gamma(t), t) + diff(alpha(t), t)

2017-12-21 21:16:56 +0200 received badge  Editor (source)
2017-12-21 20:43:28 +0200 asked a question 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)