The capital gains tax rate applies only to investment-based income. If you have a mix of earned income and investment income, you must calculate each set of income based on its relevant tax bracket.