Half Wave Rectifier with Capacitive Filter
I think your workbook is wrong with that formula. They have used the full wave rectifier formula. For HWR, It has to be :
$$V_{dc} = V_m - I_{dc}/2fC$$
Your derivation is correct.

From the above waveform,
$$V_{dc} = V_m - V_{rpp}/2$$ from ripple waveform, the amount of charge stored by the capacitor = The charge lost by it in time T seconds. i.e.,
$$C V_{rpp}= I_{dc}T$$
which gives, $$V_{rpp} = I_{dc}/fC$$
Therefore,
$$V_{dc} = V_m - I_{dc}/2fC$$