# Working with Symbolics.jl... how to extract terms from a sum etc?

I have a simple example I’m trying to construct in which I define an expression in h that has a variable f, substitute f for a linear function of h and then expand that to get a polynomial in h. So far, so good… Now what I’d like to do is take this sum and extract each term and look at the size of each term given some numerical values for the variables.

How can I split a polynomial into individual terms?

Also how can I tell symbolics to collect all the powers of h ?

``````using Symbolics
@variables w f h k

wexpr = 1.8 * f * h^3 + 1.0 *(1-f)*h^3
fexpr = 0.15 + k * (h-.6)
wexpr = substitute(wexpr,Dict([f => fexpr]))
wexpr = simplify(wexpr,expand=true)
``````

I want to show that the h^4 term is small relative to the h^3 terms, and that the derivative of that term is small relative to the derivatives of the h^3 terms.

In something like Maxima I’d do this no problem and I know how to accomplish it. Is there a simple way to split this up and evaluate each term separately in Julia?