margin percentage for the quarter was primarily the result of promotional activity we rolled out during the second quarter of 2020 that did not occur in the second quarter of 2021.
Selling, general, and administrative: Selling, general, and administrative (“SG&A”) expenses were $232.3 million for the three months ended June 30, 2021, an increase of $101.1 million, or 77.0%, as compared to $131.2 million from the corresponding period in 2020. As a percentage of revenue, SG&A expenses were 58.9% as compared to 59.6% for the three months ended June 30, 2021 and 2020, respectively. For the six months ended June 30, 2021, SG&A expenses increased $185.1 million, or 76.2%, to $428.0 million from $242.9 million for the corresponding period in 2020. As a percentage of sales, SG&A expenses were 58.2% for the six months ended June 30, 2021 as compared to 61.0% for the corresponding period in 2020. The increase in SG&A for the quarter and six months ended June 30, 2021 were primarily due to higher OPTAVIA commission expense, increased salaries and benefits related expenses for employees, increased consulting costs related to information technology projects, and increased credit card fees resulting from higher sales. SG&A expenses included research and development (“R&D”) costs of $1.1 million and $0.5 million for the three months ended June 30, 2021 and 2020, respectively, and $2.2 million and $1.1 million for the six months ended June 30, 2021 and 2020, respectively.
OPTAVIA commission expense, which is a variable expense, increased $80.4 million, or 87.5%, to $172.4 million for the three months ended June 30, 2021 from $92.0 million for the corresponding period in 2020. For the six months ended June 30, 2021, OPTAVIA commission expense increased $152.3 million, or 91.6%, to $318.7 million from $166.3 million for the corresponding period in 2020. The increase was primarily the result of increased OPTAVIA product sales. This trend is the result of the success we are experiencing with our growing OPTAVIA Integrated Coach Model. The total number of active earning OPTAVIA Coaches for the three months ended June 30, 2021 increased to 59,200 from 36,500 for the corresponding period in 2020, an increase of 62.2%. As OPTAVIA revenue increased as a portion of the Company’s total sales mix, the commission rate as a percentage of revenue increased 190 basis points to 43.7% for the second quarter of 2021 compared to 41.8% for the second quarter last year and increased 170 basis points to 43.4% for the six months ended June 30, 2021 compared to 41.7% for the corresponding period in 2020.
Income from operations: For the three months ended June 30, 2021, income from operations increased $33.3 million to $61.4 million from $28.1 million for the corresponding period in 2020 primarily as a result of increased gross profit partially offset by increased SG&A expenses. Income from operations as a percentage of revenue was 15.6% and 12.8% for the three months ended June 30, 2021 and 2020, respectively. For the six months ended June 30, 2020, income from operations increased $62.6 million to $114.2 million from $51.6 million for the corresponding period in 2020 primarily as a result of increased gross profits partially offset by increased SG&A expenses. Income from operations as a percentage of sales was 15.5% and 13.0% for the six months ended June 30, 2021 and 2020, respectively.
Income from operations before income taxes: Income from operations before income taxes was $61.3 million for the three months ended June 30, 2021 as compared to $28.2 million for the three months ended June 30, 2020, an increase of $33.1 million. Income from operations before income taxes as a percentage of revenue increased to 15.6% for the three months ended June 30, 2021 from 12.8% for the three months ended June 30, 2020. Income from operations before income taxes was $114.2 million for the six months ended June 30, 2021 as compared to $51.8 million for the six months ended June 30, 2020. Income from operations before income taxes as a percentage of sales increased to 15.5% for the six months ended June 30, 2021 from 13.0% for the six months ended June 30, 2020.
Provision for income tax: For the three months ended June 30, 2021, the Company recorded $14.4 million in income tax expense, an effective tax rate of 23.4%, as compared to $6.2 million in income tax expense, an effective tax rate of 22.1%, for the three months ended June 30, 2020. For the six months ended June 30, 2021, the Company recorded $26.2 million in income tax expense, an effective rate of 22.9%, as compared to $11.4 million in income tax expense, an effective rate of 22.0%, for the six months ended June 30, 2020. The increase in the effective tax rate for the quarter and six months ended June 30, 2021 was primarily driven by an increase in the state income tax rate and limitations on the deductibility of officer compensation offset by an increase in the tax benefit of stock compensation.
Net income: Net income was $47.0 million and $88.0 million, or $3.96 and $7.42 per diluted share, for the three and six months ended June 30, 2021 as compared to $21.9 million and $40.4 million, or $1.86 and $3.42 per diluted share, for the