Calculating capital gains involves subtracting the purchase price (or cost basis) of the asset from the sale price. Any improvements made to the asset, associated costs, and depreciation may also be factored into the cost basis. The resulting figure is the capital gain, which is then subject to taxation.