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 (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]&