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 and adding a new simplification rule does not work #1285

Open
danielpporras opened this issue Sep 22, 2024 · 0 comments
Open

simplify and adding a new simplification rule does not work #1285

danielpporras opened this issue Sep 22, 2024 · 0 comments

Comments

@danielpporras
Copy link

I would like to simplify (2 + 4sin(x)^2 - 2cos(x)^2)/sin(x)^2 as the expression is actually equal to 6. However, simplify does not work because it does not apply the identity 1 - cos(x)^2 = sin(x)^2. 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.

julia> using Symbolics
julia> @variables x
1-element Vector{Num}:
 x
julia> simplify((2 + 4sin(x)^2 - 2cos(x)^2)/sin(x)^2)
(2 + 4(sin(x)^2) - 2(cos(x)^2)) / (sin(x)^2)
julia> simplify((2 + 4sin(x)^2 - 2cos(x)^2)/sin(x)^2, @acrule 1 + -1cos(~x)^2 => sin(~x)^2)
(2 + 4(sin(x)^2) - 2(cos(x)^2)) / (sin(x)^2)
@danielpporras danielpporras changed the title Adding a new simplification rule does not work adding a new simplification rule does not work Sep 22, 2024
@danielpporras danielpporras changed the title adding a new simplification rule does not work simplify and adding a new simplification rule does not work Sep 22, 2024
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