# Formatting rules for Symbolic.arguments

**URL:** https://discourse.julialang.org/t/formatting-rules-for-symbolic-arguments/129993
**Category:** General Usage
**Tags:** question, package
**Created:** [June 18, 2025, 2:05pm UTC](https://discourse.julialang.org/t/formatting-rules-for-symbolic-arguments/129993 "2025-06-18T14:05:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![lukketotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lukketotte/32/217106_2.png) [@lukketotte](https://discourse.julialang.org/u/lukketotte)
#### Post date: [June 18, 2025, 2:05pm UTC](https://discourse.julialang.org/t/formatting-rules-for-symbolic-arguments/129993/1 "2025-06-18T14:05:36Z")

</div>

Hi everyone. New to symbolic algebra in Julia and have a question about getting arguments from [Symbolic.jl](https://symbolics.juliasymbolics.org/stable/) (using v. 6.41.0) expression. Is there any reason for the following differing formatting behavior in `Symbolics.arguments

```julia
@variables x
f1 = cos(x)
f2 = cos(x) + sin(x)

```

```julia
In: Symbolics.arguments(Symbolics.value(f1))
Out: 1-element SymbolicUtils.SmallVec{Any, Vector{Any}}:
  x

```

```julia
In: Symbolics.arguments(Symbolics.value(f2))
Out: 2-element SymbolicUtils.SmallVec{Any, Vector{Any}}:
  cos(x)
  sin(x)

```

Might be misunderstanding but the result for f1 is what I would expect from `Symbolics.get_variables`. What is the simplest way of obtaining `cos(x)` from `Symbolics.arguments(Symbolics.value(f1))` ?

Thanks!

---

<div class="post-metadata">

### Author: ![JADekker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jadekker/32/210281_2.png) [@JADekker](https://discourse.julialang.org/u/JADekker)
#### Post date: [June 18, 2025, 2:42pm UTC](https://discourse.julialang.org/t/formatting-rules-for-symbolic-arguments/129993/2 "2025-06-18T14:42:32Z")

</div>

I’m guessing it interprets f2 as +(cos(x), sin(x))?

---

<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: [June 18, 2025, 2:49pm UTC](https://discourse.julialang.org/t/formatting-rules-for-symbolic-arguments/129993/3 "2025-06-18T14:49:16Z")

</div>

> [@lukketotte](#):
>
> Might be misunderstanding but the result for f1 is what I would expect from `Symbolics.get_variables`. What is the simplest way of obtaining `cos(x)` from `Symbolics.arguments(Symbolics.value(f1))` ?

`f1` is `cos(x)`, so the argument of the function is `x` while its operator is `cos`. `f2` is `+(cos(x),sin(x))`, so the operator is `+` and the arguments are `[cos(x), sin(x)]`

---

<div class="post-metadata">

### Author: ![lukketotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lukketotte/32/217106_2.png) [@lukketotte](https://discourse.julialang.org/u/lukketotte)
#### Post date: [June 18, 2025, 2:53pm UTC](https://discourse.julialang.org/t/formatting-rules-for-symbolic-arguments/129993/4 "2025-06-18T14:53:03Z")

</div>

Thanks for the replies. Misunderstanding on my part!
