Skip to content

Series approximations to e to the x and ln x

Question

How would you approximate exe^x and ln⁡x\ln x numerically, and what can be said about the size of the error?

Short answer

Truncated Taylor series. ex≈∑k=0nxk/k!e^x\approx\sum_{k=0}^{n}x^k/k! with Lagrange remainder eξ∣x∣n+1/(n+1)!e^{\xi}|x|^{n+1}/(n+1)!; ln⁡(1+u)≈u−u2/2+⋯±un/n\ln(1+u)\approx u-u^2/2+\dots\pm u^n/n for ∣u∣<1|u|<1, where for 0<u≤10<u\le1 the alternating-series error is below the first omitted term un+1/(n+1)u^{n+1}/(n+1). In practice one first reduces the argument (e.g. ex=(ex/2m)2me^x=(e^{x/2^m})^{2^m}, ln⁡x=mln⁡2+ln⁡y\ln x=m\ln2+\ln y) so the series converges fast.

Adapted from Joshi, Denson & Downes, Quant Job Interview Questions and Answers, Q6.15, p.190; question and answer rewritten by SelfMadeQuant.com.

See the hint and the full worked solution in the question bank (free account).

Open the worked solution

Lessons behind this question