OK, first thing first, you're also trying (in a syntactically incorrect way) to append STDOUT to the log too (which would never actually assign anything to the variable.... if the whole thing was enclosed in backticks... ).
I believe that you want this:
Code:
a=`expr ${i} + ${j} 2>>${log_file}`