# Simplifying expression

I have the following expression:

(1 - a) (H - 3 L*r + L)


and I would like to simplify' this to

(1 - a) (H - L(3 r +1))


I thought that maybe Simplify or Collect could work, but to no avail.

What's the right function to achieve this?

• expr = (1 - a) (H - 3 L*r + L); Collect[#, L] & /@ expr Feb 2, 2021 at 21:34

You can map HornerForm to each factor:
expr = (1 - a) (H - 3 L*r + L);

(1 - a) (H + L (1 - 3 r))
`