Research and Development. Research and development expense is primarily comprised of compensation expense. Research and development expense increased by $14.7 million, or 10.8%, to $150.8 million in the six months ended March 31, 2021, from $136.1 million in the six months ended March 31, 2020. Research and development expense increased as a percentage of revenue from 6.5% in the six months ended March 31, 2020, to 7.1% in the six months ended March 31, 2021, as we accelerate our investment in our cloud offering, 5G and network related innovation and developing our digital offerings as well as our media offerings. Our research and development efforts are a key element of our strategy and are essential to our success, and we intend to maintain our commitment to research and development. An increase or decrease in our revenue would not necessarily result in a proportional increase or decrease in the levels of our research and development expenditures, which could affect our operating margin.
Selling, General and Administrative. Selling, general and administrative expense, which is primarily comprised of compensation expense, decreased by $3.7 million, or 1.5%, to $238.8 million in the six months ended March 31, 2021, from $242.6 million in the six months ended March 31, 2020. Selling, general and administrative expense decreased as a percentage of revenue from 11.6% in the six months ended March 31, 2020, to 11.2% in the six months ended March 31, 2021. The decrease is mainly due to lower selling and marketing and travel costs in the six months ended March 31, 2021 compared to the six months ended March 31, 2020 as a result of the COVID-19 restrictions and was also attributable to decrease in the account receivable allowances. The decrease was partially offset by selling, general and administrative expense, attributable to acquisitions completed in fiscal year 2020. Selling, general and administrative expense may fluctuate from time to time, depending upon such factors as changes in our workforce and sales efforts and the results of any operational efficiency programs that we may undertake.
Amortization of Purchased Intangible Assets and Other. Amortization of purchased intangible assets and other in the six months ended March 31, 2021, increased by $1.1 million, or 2.7% to $41.7 million from $40.6 million in the six months ended March 31, 2020. The increase in amortization of purchased intangible assets and other was primarily attributable to an increase in amortization of intangible assets due to acquisitions completed in fiscal year 2020, and, to a lesser extent, an increase in acquisition-related costs, partially offset by a completion of amortization of previously purchased intangible assets.
Operating Income. Operating income decreased by $10.8 million, or 3.6%, in the six months ended March 31, 2021, to $289.4 million, or 13.6% of revenue, from $300.3 million, or 14.4% of revenue, in the six months ended March 31, 2020. The decrease in operating income was attributable primarily to the increase in research and development expense during the six months ended March 31, 2021, and positive foreign exchange impacts on our revenue, resulting in a positive impact on our operating income.
Interest and Other Expense, Net. Interest and other expense, net, changed from a net expense of $2.6 million in the six months ended March 31, 2020 to a net expense of $10.0 million in the six months ended March 31, 2021. The increase in interest and other expense, net, was primarily attributable to an increase in interest expenses related to financing activities recorded in the six months ended March 31, 2021 compared to the six months ended March 31,2020, and was partially offset by foreign exchange impacts.
Gain from sale of a business. Gain from sale of a business, for the six months ended March 31, 2021, was $226.4 million, while there was no such gain in the six months ended March 31, 2020. Please see Note 4 to our consolidated financial statements.
Income Taxes. Income taxes for the six months ended March 31, 2021 were $87.1 million on pre-tax income of $505.8 million, resulting in an effective tax rate of 17.2%, compared to 18.4% in the six months ended March 31, 2020. Absent the gain from sale of a business, the effective tax rate for the six months ended March 31, 2021, would have been 17.0%. Our effective tax rate may fluctuate between periods as a result of discrete items that may affect a particular period. Please see Note 10 to our consolidated financial statements.
Net Income. Net income increased by $175.7 million, or 72.3%, to $418.7 million in the six months ended March 31, 2021, from $243.0 million in the six months ended March 31, 2020. The increase in net income was primarily attributable to the gain from sale of a business, net of tax.
Diluted Earnings Per Share. Diluted earnings per share increased by $1.39, or 77.2%, to $3.19 in the six months ended March 31, 2021, from $1.80 in the six months ended March 31, 2020. The increase in diluted earnings per share was primarily attributable to the gain from sale of a business, net of tax, which increased the diluted earnings per share for the six months ended March 31, 2021, by $1.42, as well as to the decrease in the diluted weighted average number of shares outstanding which resulted from share repurchases. Please see also Note 11 to our consolidated financial statements.
29