Linearization of a non-linear function

The log-sum-exp function

 f(x) = log(e^{x_1}+e^{x_2})

admits the gradient at the point x^0 given by

  nabla f(x_0) = frac{1}{e^{x^0_1}+e^{x^0_2}} left(begin{array}{c} e^{x_1^0}  e^{x_2^0} end{array}right) .

Hence f can be approximated near x^0 by the linear function

  f(x) approx log(e^{x_1}+e^{x_2})  +  frac{1}{e^{x^0_1}+e^{x^0_2}} left( (x_1-x_1^0) e^{x^0_1} +(x_2-x^0_2) e^{x^0_2}right)   .