# Symbolics coefficients

**URL:** <https://discourse.julialang.org/t/symbolics-coefficients/110541>\
**Category:** General Usage\
**Created:** [February 21, 2024, 8:41pm UTC](https://discourse.julialang.org/t/symbolics-coefficients/110541 "2024-02-21T20:41:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [February 21, 2024, 8:41pm UTC](https://discourse.julialang.org/t/symbolics-coefficients/110541/1 "2024-02-21T20:41:30Z")

</div>

What is happening? How do I get 4 out of this?

```julia
using Symbolics
@variables a b
julia> Symbolics.coeff(4a*b).dict
Dict{Any, Any} with 2 entries:
  a => 1
  b => 1

```

---

<div class="post-metadata">

**Author:** ![contradict](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@contradict](https://discourse.julialang.org/u/contradict)\
**Post date:** [February 21, 2024, 9:44pm UTC](https://discourse.julialang.org/t/symbolics-coefficients/110541/2 "2024-02-21T21:44:54Z")

</div>

How about

```julia
julia> polynomial_coeffs(4a*b, [a, b])
(Dict{Any, Any}(a*b => 4), 0)

```
