56

I would like to know the complete expansion of log(a + b).

For example

log(a * b) = log(a) + log(b);
log(a / b) = log(a) - log(b);

Similar to this, is there any expansion for log(a + b)?

nbro
  • 15,395
  • 32
  • 113
  • 196
Aditya Singh
  • 9,512
  • 5
  • 32
  • 55
  • 14
    Belongs on http://math.stackexchange.com – Paul R Oct 20 '10 at 06:57
  • Per @mahonya’s comment: Scipy provides a [`scipy.misc.logsumexp`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.misc.logsumexp.html) that might be very useful if you can get `log(a)` and `log(b)`! – Ahmed Fasih Apr 21 '17 at 01:05
  • 2
    This post is being discussed on [meta](https://meta.stackoverflow.com/q/403529/9513184). – Unmitigated Dec 11 '20 at 02:36
  • 1
    This is the closest math.stackexchange duplicate I could find: https://math.stackexchange.com/questions/734228/separating-the-log-of-a-sum – M. Justin Dec 11 '20 at 20:50

1 Answers1

120

In general, one doesn't expand out log(a + b); you just deal with it as is. That said, there are occasionally circumstances where it makes sense to use the following identity:

log(a + b) = log(a * (1 + b/a)) = log a + log(1 + b/a)

(In fact, this identity is often used when implementing log in math libraries).

Stephen Canon
  • 103,815
  • 19
  • 183
  • 269