Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trig pythagorean identity #8

Open
zlee-personal opened this issue Jul 15, 2017 · 3 comments
Open

trig pythagorean identity #8

zlee-personal opened this issue Jul 15, 2017 · 3 comments

Comments

@zlee-personal
Copy link

Would it be possible to add a rule that cos^2(x) + sin^2(x) = 1?

@soegaard
Copy link
Owner

Yes. Suppose you have a polynomial expression P(X,Y) in X=cos(x) and Y=sin(x) then use polynomial-quotient-remainder to calculate P(X,Y) divided by X^2+Y^2. This gives:

P(X,Y) = Q(X,Y) (X^2+Y^2) + R(X,Y).

Now since X^2+Y^2 = 1 we have: P(X,Y) = Q(X,Y) + R(X,Y). So the reduced expression is Q(cos(x),sin(x)) + R(cos(x),sin(x))

I won't have time do this soon - but patches are welcome. FWIW I notice that the functionality is called trigsimp in Maxima.

@BowenFu
Copy link
Contributor

BowenFu commented Feb 10, 2020

Looks like it is not easy for the polynomial-quotient-remainder approach to handle all the cases.
we can have cos(x), but also cos(pi*x) cos(sqrt(x), so we cannot know what X and Y is in advance.

Instead, I think we can replace cos^2(...) with 1-sin^2(x) before trig-simplify, and recover it after trig-simplify.

@soegaard
Copy link
Owner

The function (variables u) can return a list of expressions in which u is a variable.
I am thinking that a similar function could determine if an expression u has the form P(X,Y) where X=cos(v) and Y=sin(v).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants