# Symbolics 'solve' command undefined

**URL:** <https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766>\
**Category:** General Usage\
**Tags:** symbolics\
**Created:** [August 29, 2024, 11:56am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766 "2024-08-29T11:56:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Warburton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_warburton/32/206802_2.png) [@Paul\_Warburton](https://discourse.julialang.org/u/Paul_Warburton)\
**Post date:** [August 29, 2024, 11:56am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/1 "2024-08-29T11:56:28Z")

</div>

I have copied code from the Symbolics package as shown, but I get the ‘solve’ function is undefined. I must be doing something wrong but I do not see what mistake i am m  
aking. Any help would be appreciated. Thank you

 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/0/603e914cb6ff2ac70fd41dd0b79b54a99b00ad6a.png)

---

<div class="post-metadata">

**Author:** ![Paul\_Warburton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_warburton/32/206802_2.png) [@Paul\_Warburton](https://discourse.julialang.org/u/Paul_Warburton)\
**Post date:** [August 29, 2024, 11:57am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/2 "2024-08-29T11:57:26Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/3/e/3ea33a75697045843be7a9c5143215283fd68b87.png)

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [August 29, 2024, 12:10pm UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/3 "2024-08-29T12:10:27Z")

</div>

What version? Since it was released last week and requires Julia v1.10 you need to be up to date to use it

---

<div class="post-metadata">

**Author:** ![Paul\_Warburton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_warburton/32/206802_2.png) [@Paul\_Warburton](https://discourse.julialang.org/u/Paul_Warburton)\
**Post date:** [August 29, 2024, 12:13pm UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/4 "2024-08-29T12:13:34Z")

</div>

That might be it, I will update Julia.

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![Paul\_Warburton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_warburton/32/206802_2.png) [@Paul\_Warburton](https://discourse.julialang.org/u/Paul_Warburton)\
**Post date:** [August 29, 2024, 11:26pm UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/5 "2024-08-29T23:26:22Z")

</div>

Ok, so I have installed Julia 1.10, I still have the exact same response?

---

<div class="post-metadata">

**Author:** ![Paul\_Warburton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_warburton/32/206802_2.png) [@Paul\_Warburton](https://discourse.julialang.org/u/Paul_Warburton)\
**Post date:** [August 29, 2024, 11:34pm UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/6 "2024-08-29T23:34:32Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/3/d/3d1700105ab1e890c53f1c0faba9cfddcb8d2022.png)

---

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [August 29, 2024, 11:45pm UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/7 "2024-08-29T23:45:31Z")

</div>

> [@Paul\_Warburton](#):
>
> update Julia

try updating the packages. e.g., enter the Pkg repl and enter `up`

---

<div class="post-metadata">

**Author:** ![Paul\_Warburton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_warburton/32/206802_2.png) [@Paul\_Warburton](https://discourse.julialang.org/u/Paul_Warburton)\
**Post date:** [August 30, 2024, 2:26am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/8 "2024-08-30T02:26:52Z")

</div>

This still does not work. Can someone confirm please that it works for them?

---

<div class="post-metadata">

**Author:** ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)\
**Post date:** [August 30, 2024, 5:25am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/9 "2024-08-30T05:25:09Z")

</div>

So for me it also doesn’t work:

```julia-repl
julia> Pkg.activate(;temp=true); Pkg.add("Symbolics"); using Symbolics
# ...
    Updating `/tmp/jl_PdF79T/Project.toml`
  [0c5d862f] + Symbolics v6.4.0
# ...
julia> @variables x
1-element Vector{Num}:
 x

julia> solve(x^2-9,x)
ERROR: UndefVarError: `solve` not defined
Stacktrace:
 [1] top-level scope
   @ REPL[4]:1

julia> Symbolics.sol<Tab>
solve_for
solve_multipoly
solve_multivar
solve_univar

julia> versioninfo()
Julia Version 1.10.4
Commit 48d4fd48430 (2024-06-04 10:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 7 4800H with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver2)
Threads: 1 default, 0 interactive, 1 GC (on 16 virtual cores) 

```

Should `solve` exist? I don’t see it in the docs at first glance. `symbolic_solve` which I see in the docs does exist:

```julia-repl
julia> symbolic_solve(x^2-9,x)
ERROR: "Nemo is required. Execute `using Nemo` to enable this functionality."
Stacktrace:
 [1] factor_use_nemo(poly::Num)
   @ Symbolics ~/.julia/packages/Symbolics/e7UFe/src/solver/nemo_stuff.jl:14
 [2] solve_univar(expression::Num, x::Num; dropmultiplicity::Bool)
   @ Symbolics ~/.julia/packages/Symbolics/e7UFe/src/solver/main.jl:260
 [3] symbolic_solve(expr::Num, x::Num; dropmultiplicity::Bool, warns::Bool)
   @ Symbolics ~/.julia/packages/Symbolics/e7UFe/src/solver/main.jl:156
 [4] symbolic_solve(expr::Num, x::Num)
   @ Symbolics ~/.julia/packages/Symbolics/e7UFe/src/solver/main.jl:113
 [5] top-level scope
   @ REPL[6]:1

```

The only exported function starting with `solv` is `solve_for` which is deprecated:

```julia-repl
julia> solve_for(x^2-9,x)
┌ Warning: solve_for is deprecated, please use symbolic_linear_solve instead.
│ caller = top-level scope at REPL[7]:1
└ @ Core REPL[7]:1
ERROR: AssertionError: islinear
...

```

There are some more functions starting with `symbolic`:

```julia-repl
julia> symbolic
symbolic_linear_solve
symbolic_solve
symbolics_to_sympy

```

And with Nemo.jl, `symbolic_solve` solves the equation:

```julia-repl
julia> using Nemo;
julia> symbolic_solve(x^2-9,x)
2-element Vector{BigInt}:
  3
 -3

```

---

<div class="post-metadata">

**Author:** ![Paul\_Warburton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_warburton/32/206802_2.png) [@Paul\_Warburton](https://discourse.julialang.org/u/Paul_Warburton)\
**Post date:** [August 30, 2024, 6:01am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/10 "2024-08-30T06:01:10Z")

</div>

Nope, this still doesn’t work at all, exactly the same outcome

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [August 30, 2024, 8:04am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/11 "2024-08-30T08:04:47Z")

</div>

Make sure you update your packages including Symbolics and Nemo. Then this works:

```julia
julia> using Symbolics

julia> import Nemo

julia> @variables x;

julia> symbolic_solve([x-1, x^2-1], x)
1-element Vector{BigInt}:
 1

```

To be extra sure it’ll work, you could create a clean virtual environment and install Symbolics and Nemo. Then it has to work.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [August 30, 2024, 8:14am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/12 "2024-08-30T08:14:06Z")

</div>

I can also confirm that it works in a fresh environment with Julia 1.10.5 when you just `] add Symbolics Nemo`.

```julia
julia> using Symbolics

julia> import Nemo

Welcome to Nemo version 0.46.2

Nemo comes with absolutely no warranty whatsoever

julia> @variables x;

julia> symbolic_solve([x-1, x^2-1], x)
1-element Vector{BigInt}:
 1

```

---

<div class="post-metadata">

**Author:** ![Yassin\_ElBedwihy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yassin_elbedwihy/32/208506_2.png) [@Yassin\_ElBedwihy](https://discourse.julialang.org/u/Yassin_ElBedwihy)\
**Post date:** [August 30, 2024, 8:39am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/13 "2024-08-30T08:39:49Z")

</div>

Hello @Paul_Warburton & @abraemer .  
1- the function is called `symbolic_solve`, all the other functions you’ve mentioned do not exist except for `solve_for` which is now renamed to `symbolic_linear_solve` and only solves linear equations.

2- To use `symbolic_solve` you need Symbolics.jl v6.3 or above. Please make sure you’re using the correct versions.

```repl
(@v1.10) pkg> status Symbolics
Status `~/.julia/environments/v1.10/Project.toml`
  [0c5d862f] Symbolics v6.3.0 `../../../code/julia/Symbolics.jl`

```

3- Read error messages! using your examples:

```julia
julia> using Symbolics

julia> @variables x
1-element Vector{Num}:
 x

julia> symbolic_solve(x^2-9,x)
ERROR: "Nemo is required. Execute `using Nemo` to enable this functionality."

```

The error tells me to execute `using Nemo`, so ill listen

```julia
julia> using Nemo

Welcome to Nemo version 0.45.7

Nemo comes with absolutely no warranty whatsoever

julia> symbolic_solve(x^2-9,x)
2-element Vector{BigInt}:
  3
 -3

```

Hope this helps.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [August 30, 2024, 10:26am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/14 "2024-08-30T10:26:37Z")

</div>

@Yassin_ElBedwihy we should add a `!!! note` to the solver docs page about handling the extension package usage with this. I can see there that it doesn’t have an explicit call out, and that would be a very helpful thing to highlight.

---

<div class="post-metadata">

**Author:** ![Paul\_Warburton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_warburton/32/206802_2.png) [@Paul\_Warburton](https://discourse.julialang.org/u/Paul_Warburton)\
**Post date:** [August 31, 2024, 6:06am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/15 "2024-08-31T06:06:02Z")

</div>

Thanks Yassin,

I believe I have the updated components, but it still does not work.

I would really like to use symbolics for a project I am working on, I just don’t know what else to do?

Please advise what else might be causing this issue?

Cheers, Paul

![](https://global.discourse-cdn.com/julialang/original/3X/2/1/214685df1de45deb14eaa3c8b1de761ab0b59ba3.png)

---

<div class="post-metadata">

**Author:** ![Paul\_Warburton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_warburton/32/206802_2.png) [@Paul\_Warburton](https://discourse.julialang.org/u/Paul_Warburton)\
**Post date:** [August 31, 2024, 6:16am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/16 "2024-08-31T06:16:20Z")

</div>

The expand command works but the symbolic\_linear\_solve command still says it is undefine, just like previously. This is not caused by outdated software, everything is at least of versions specified as required.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [August 31, 2024, 7:09am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/17 "2024-08-31T07:09:27Z")

</div>

Further up you showed output from a jupyter notebook, whereas in your last post you showed that Symbolics is up to date in the default/global environment (`v1.10`) in your REPL. Maybe the notebook is using a different, local environment with an older Symbolics.jl version?

Have you ran the commands that work for others here in the REPL or only in the notebook? If the latter, what output does `] status` (or `using Pkg; Pkg.status()`) give in the notebook?

---

<div class="post-metadata">

**Author:** ![Paul\_Warburton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_warburton/32/206802_2.png) [@Paul\_Warburton](https://discourse.julialang.org/u/Paul_Warburton)\
**Post date:** [August 31, 2024, 8:03am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/18 "2024-08-31T08:03:18Z")

</div>

You are VERY clever, somehow I still have the old versions in Notebook. Julia v1.9 and Symbolics v5.1.0. I will try and update them in notebooks as that is what I am using. Thank you 🙂

---

<div class="post-metadata">

**Author:** ![Paul\_Warburton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_warburton/32/206802_2.png) [@Paul\_Warburton](https://discourse.julialang.org/u/Paul_Warburton)\
**Post date:** [August 31, 2024, 8:24am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/19 "2024-08-31T08:24:32Z")

</div>

That is it! It is working, I needed to update Julia and Symbolics in Notebook! I was updating it in REPL, whatever that means! Thank you everyone for your patience 🙂

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [August 31, 2024, 8:42am UTC](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766/20 "2024-08-31T08:42:41Z")

</div>

Glad you found the issue. To clarify, there seem to have been two issues.

1. It looks like you had multiple Julia versions installed (totally fine) but have either selected the wrong kernel (1.9 instead of 1.10) or didn’t have a 1.10 kernel to begin with.

2. By default, jupyter notebooks use the Julia environment (Project.toml) that is closest to the notebook file (e.g. in the same folder). It seems that in this environment, Symbolics.jl was out of date. The REPL on the other hand always uses the global environment by default. This is the one you see in your REPL screenshot. (Of course, in both cases, you can override the default and choose a specific environment explicitly)

[Next page](https://discourse.julialang.org/t/symbolics-solve-command-undefined/118766.md?page=2)
