Net income increased from $28,135,000 for the nine months ended September 30, 2012 to $47,503,000 for the nine months ended September 30, 2013. This increase was primarily the result of improved market conditions in the biodiesel industry. Also contributing to a lesser degree was a steady improvement in the chemicals segment profits and in the profits from the sale of investments. Additionally, net income was benefitted by certain non-recurring or unpredictable items. These items include the impact of the retroactive reinstatements of the $1.00 per gallon biodiesel blenders' credit and the agri-biodiesel production credit for 2012. The retroactive reinstatement of the $1.00 per gallon biodiesel blenders' credit for 2012 increased the first nine months 2013 net income by $2,535,000 on a pretax basis, $1,541,000 on an after-tax basis. The retroactive reinstatement of the agri-biodiesel biodiesel production credit for 2012 benefitted net income in the first nine months of 2013 by $912,000 on an after-tax basis. While both of these items pertained to 2012 activity, their benefit was not recorded as a component of net income until 2013 as the law granting these benefits was not enacted until then. Both the $1.00 per gallon biodiesel blenders' credit and agri-biodiesel production credits are set to expire at December 31, 2013. Also increasing net income was the take or pay payments from other custom chemical customers in the amount of $2,916,000 in the nine months ended September 30, 2013 on a pre-tax basis; $1,799,000 on an after-tax-basis.
Further impacting net income in the nine months of 2013 were: (i) the recognition of the net impairment on the intermediate anode material fixed assets of $1,420,000 on a pre-tax basis' $876,000 on an after-tax basis; and (ii) the net realized gains on derivative instruments. Such net gains increased net income by $1,719,000 in the nine months ended September 30, 2013 on a pretax basis' $1,059,000 on an after-tax basis. In the nine months ended September 30, 2012, net income increased $3,065,000 on a pretax basis, $1,888,000 on an after-tax basis, as a result of net realized and unrealized gains on derivative instruments. Changes in the fair value of our derivative instruments are recognized at the end of each accounting period and recorded in the statement of operations as a component of cost of goods sold. Our immediate recognition of derivative instrument gains and losses can cause net income to be volatile from period to period due to the timing of the change in value of the derivative instruments relative to the sale of biofuel being sold.