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

simplify fails on certain trig identities and adding a new rule does not work #655

Open
danielpporras opened this issue Oct 4, 2024 · 0 comments

Comments

@danielpporras
Copy link

I would like to simplify 2 - 2cos(x)^2 to 2sin(x)^2. However, simplify does not work because it does not apply the identity. I attempted to write a new rule in several ways such as @acrule 1 + -1cos(~x)^2 => sin(~x)^2 but that has not yet worked. I, of course, want the rule work for any constant a such that a - a*cos(x)^2 goes to a*sin(x)^2.

julia> using SymbolicUtils
julia> @syms x
(x,)
julia> simplify(2 - 2cos(x)^2)
2 - 2(cos(x)^2)
julia> simplify(2 - 2cos(x)^2, @acrule 1 + -1cos(~x)^2 => sin(~x)^2)
2 - 2(cos(x)^2)
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

1 participant