# Expanding logarithms: lnexpand

### 5.24.3 Expanding logarithms: lnexpand

The logarithm applied to a product can be converted into a sum of logarithms; namely,

log(x· y) = log(x) + log(y)

The lnexpand command does this expansion.

- lnexpand takes one argument:
  expr, an expression.
- lnexpand(expr) returns the expression expr with logarithms of products rewritten as sums of logarithms.

#### Example.

Input:

lnexpand(ln(3*x^2)+ln(2*x+2))

Output:

ln | ⎛ ⎝ | 3 | ⎞ ⎠ | +2 ln | ⎪ ⎪ | x | ⎪ ⎪ | +ln | ⎛ ⎝ | 2 | ⎞ ⎠ | +ln | ⎛ ⎝ | x+1 | ⎞ ⎠