You are trying to maximize the value of 18 - 5 sin (junk). The greatest value for 18 - 5 sin (junk) occurs when the sine function is at a minimum, because its coefficient is negative. This is when sin(junk) = -1, which nets you 23 from your function.