You will need to define the function as a composite function. In Mathcad 15, you can do this a local function definition within the Maximize function. The way you have tried to apply the maximize function means that it is attempting to maximize d, which has no finite maximum.
The attached (linked?) file is saved in M11 format but should be run under M15 (well, OK, M13 or greater) to see the effect of the local function definition.