For Cap gains and qualified dividends, special calculations are used...and the initial $$ amounts of those may not be taxed at all ( 0% ), even though they are included on the "taxable" income line.
____________*Answers are correct to the best of my knowledge when posted, but should not be considered to be legal or official tax advice.*