Symbolics.jl icon indicating copy to clipboard operation
Symbolics.jl copied to clipboard

Solving equation fails

Open jariji opened this issue 1 year ago • 3 comments

Symbolics.jl can't solve this equation but if I multiply both sides by x^3 then it can. Wolfram Alpha can solve both. Symbolics.jl's docs say it can do polynomial equations, what's the problem here?

  [2edaba10] Nemo v0.46.2
  [0c5d862f] Symbolics v6.11.0

using Symbolics, Nemo
@variables x y
julia> symbolic_solve(1/x^2 ~ 1/y^2 - 2/x^3 * (x-y), x)
┌ Warning: This expression cannot be solved with the methods available to ia_solve. Try a numerical method instead.
└ @ Symbolics ~/.julia/packages/Symbolics/6WqId/src/solver/ia_main.jl:176

julia> symbolic_solve( (1/x^2 * x^3 ~ (1/y^2 - 2/x^3 * (x-y)) * x^3), x)
[ Info: Assuming (y^2) != 0
[ Info: Assuming (y^2) != 0
2-element Vector{SymbolicUtils.BasicSymbolic{Real}}:
 y
 -2y

jariji avatar Sep 12 '24 02:09 jariji

Easier to reproduce:

using Symbolics, Nemo

@variables x y
symbolic_solve(1/x^2 ~ 1/y^2 - 2/x^3 * (x-y), x)
# symbolic_solve( (1/x^2 * x^3 ~ (1/y^2 - 2/x^3 * (x-y)) * x^3), x)

using

(sym) pkg> st
Status `~/repos/sym/Project.toml`
  [2edaba10] Nemo v0.46.2
  [0c5d862f] Symbolics v6.11.0

@jariji Can you change the title to "Solving equation fails" ?

ufechner7 avatar Sep 12 '24 02:09 ufechner7

@n0rbed take a look?

ChrisRackauckas avatar Sep 12 '24 02:09 ChrisRackauckas

Here's another one that yields the same issue today (Symbolics 6.38.0; the above example being fine now):

using Symbolics, Nemo
@variables x y

symbolic_solve(x + y - 1 / (x * y), x)
┌ Warning: This expression cannot be solved with the methods available to ia_solve. Try a numerical method instead.
└ @ Symbolics ~/.julia/packages/Symbolics/B6Z8m/src/solver/ia_main.jl:52

sschuldenzucker avatar Apr 19 '25 21:04 sschuldenzucker