Please help me find the formula for b). I have tried everything already and it is driving me nuts trying to find a formula for this problem.

So far I have this f(x) = { 1 x > 1

{1 + x

f(x) = { 1 x > 1

{(10)(x) + x

I understand that the problem is asking for the formula but what I don't get is how to write a formula for it. Every problem is different so how as I suppose to write a general formula for it. Such as if the difference is .99 the maximum the customer would get back is 5 dollars + .99. So that wouldn't be the same for if the difference was .10. Please help me with this.

Thanks.