Real decisions have more than one goal: cheap and fast, safe and profitable. Usually no choice is best at every goal. A choice is Pareto optimal if you cannot improve one goal without making another worse. The set of such choices is the trade-off curve; the decision maker then picks a point on it.
With two goals f_1(x) and f_2(x) to minimise, give each a weight and add: \min_x\; w\, f_1(x) + (1-w)\, f_2(x), \qquad 0 \le w \le 1 . In words: w says how much you care about goal 1; w near 1 favours f_1, w near 0 favours f_2.
When f_1 and f_2 are convex, every weight gives a Pareto point, and varying w traces the curve. Weights have a limit: when a goal is not convex, some Pareto points are missed. Then use the other standard tool, the \varepsilon-constraint: \min_x\; f_2(x) \quad\text{subject to}\quad f_1(x) \le \varepsilon . In words: fix the most you will accept on goal 1, and do as well as possible on goal 2.
Choose one number x. Goal 1 is the cost f_1 = (x-1)^2 (best at x=1); goal 2 is the delay f_2 = (x-4)^2 (best at x=4). Nothing is best at both. Care about cost four times as much as delay (weight 0.8 on goal 1 against 0.2):
minimize 0.8*(x - 1)^2 + 0.2*(x - 4)^2
# weight 0.8 on cost, 0.2 on delay
The compromise is x=1.6. Equal care:
minimize 0.5*(x - 1)^2 + 0.5*(x - 4)^2
# equal weights
gives x=2.5, and favouring delay (weight 0.2 on cost) gives
minimize 0.2*(x - 1)^2 + 0.8*(x - 4)^2
# weight 0.2 on cost, 0.8 on delay
x=3.4. As the weight moves, the choice slides from one best point to the other: every x between 1 and 4 is Pareto optimal, and these three are samples of the curve.
Now use the \varepsilon-constraint: accept a cost of at most 1 and minimise the delay:
minimize (x - 4)^2
subject to
(x - 1)^2 <= 1
# cost at most 1
The best delay is 4 at x=2. Change the 1 to 4 and the cost bound loosens, so the delay falls. The library problems L03-21 and L03-22 show the same idea in a regression, where weights decide how much each point counts.