Methods for performing dose determination and cost function gradients in a radiation therapy are disclosed, which include: discretizing a volume-of-interest (VOI) into a set of voxels identifying a set of beamlets which deposit dose contributions of radiation to the VOI, and each beamlet has a weight factor transforming the dose contributions into a first domain, and transforming the weight factors into a second domain orthogonal to the first domain calculate the local derivatives of a cost function of dose and cost function gradients with respect to the weights of the beamlets.