How many even four-digit numbers, all of the digits different, can be formed from the digits 0 to 8, if there must be a 4 in the number?

8 digits to select from, plus a 4

If the number ends in 4, then that leaves 8P3 = 336 ways to choose the other 3 digits.
If the number ends in a 0,2,6,8 then 4*7P3*3 = 2520
so, 336+2520 = 2856 ways

"If the number ends in 4, then that leaves 8P3 = 336.."

that would include cases such as 0564, which is not considered a 4 digit number.
so the number of cases of ending in 4, starting with 0, have to be excluded

A similar situation exists for the cases of ending in 2, 6, or 8