R(x) = If[0 ≤ x ≤ 40,(-50 * x^(2)) + (2000 * x)]
C(x) = If[0 ≤ x ≤ 40,(1 / 3 * x^(3)) + 620]
B(x) = R(x) - C(x)