To find how many more items the first plant produces daily than the second plant, we have to subtract from the number of widgets the first plant produces the second plant produces. So,
(8x+17)-(5x-7)\\ \\=8x+17-5x+7\ [\text{Eliminate brackets}]\\ \\=(8x-5x)+(17+7)\ [\text{Combine the like terms}]\\ \\=3x+24