This question already has an answer here:

I often find myself using // when playing around with expressions, but it is always cumbersome to have to switch to the full notation just to apply a function of two arguments.

(x+1)^3 // Expand
Collect[(x+1)^3 // Expand, x]

I found that there is one way to do this using a pure function, though I'm not sure if this is the best way

(x+1)^3 // Expand // Collect[#, x]&

marked as duplicate by ybeltukov, Teake Nutma, Szabolcs, RunnyKine, bobthechemist Oct 12 '14 at 21:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.