Function composition with linear and quadratic functions