For the cost of preference shares, you are correct (although strictly it is D/Po where D is the dividend (preference shares are paid a constant dividend) and Po is the market value)
For the cost of debt, it is I(1-T)/Po (when the debt is irredeemable – T is the tax rate, because debt interest is tax allowable). If the debt is redeemable then you need to calculate the IRR.