Research and Development. Research and development expense is primarily comprised of compensation expense. Research and development expense increased by $25.4 million, or 12.3%, to $231.6 million in the nine months ended June 30, 2021, from $206.2 million in the nine months ended June 30, 2020. Research and development expense increased as a percentage of revenue from 6.6% in the nine months ended June 30, 2020, to 7.2% in the nine months ended June 30, 2021, as we accelerate our investment in our cloud offering, 5G and network related innovation and developing our digital 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, increased by $9.1 million, or 2.6%, to $361.2 million in the nine months ended June 30, 2021, from $352.2 million in the nine months ended June 30, 2020. The increase was primarily attributable to acquisitions completed in fiscal year 2020 which was partially offset by lower travel costs as a result of the COVID-19 restrictions. 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 nine months ended June 30, 2021, increased by $2.6 million, or 4.5% to $60.5 million from $57.9 million in the nine months ended June 30, 2020. The increase in amortization of purchased intangible assets and other was primarily attributable to an increase in acquisition-related costs and to an increase in amortization of intangible assets due to acquisitions completed in fiscal year 2020, partially offset by a completion of amortization of previously purchased intangible assets.
Operating Income. Operating income decreased by $3.5 million, or 0.8%, in the nine months ended June 30, 2021, to $444.4 million, or 13.9% of revenue, from $447.8 million, or 14.4% of revenue, in the nine months ended June 30, 2020. The decrease in operating income was attributable primarily to the increase in research and development expense, partially offset by operational excellence initiatives and the divestiture of OpenMarket completed on December 31, 2020, during the nine months ended June 30, 2021. In addition, positive foreign exchange impacts on our revenue, resulted in a positive impact on our operating income.
Interest and Other Income (Expense), Net. Interest and other income (expense), net, changed from a net expense of $5.1 million in the nine months ended June 30, 2020 to a net expense of $9.7 million in the nine months ended June 30, 2021. The increase in interest and other income (expense), net, was primarily attributable to an increase in interest expenses related to financing activities which was partially offset by other net income and foreign exchange impacts.
Gain from sale of a business. Gain from sale of a business, for the nine months ended June 30, 2021, was $226.4 million, while there was no such gain in the nine months ended June 30, 2020. Please see Note 4 to our consolidated financial statements.
Income Taxes. Income taxes for the nine months ended June 30, 2021 were $96.2 million on pre-tax income of $661.1 million, resulting in an effective tax rate of 14.6%, compared to 17.9% in the nine months ended June 30, 2020. Absent the gain from sale of a business, the effective tax rate for the nine months ended June 30, 2021, would have been 13.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 $201.5 million, or 55.4%, to $564.8 million in the nine months ended June 30, 2021, from $363.4 million in the nine months ended June 30, 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.64, or 60.7%, to $4.34 in the nine months ended June 30, 2021, from $2.70 in the nine months ended June 30, 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 nine months ended June 30, 2021, by $1.43, and, to a lesser extent low effective tax rate 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