Logarithm

The solution x(t) of the initial value problem

  • \frac{dx}{dt}=\frac{1}{t} for t>1
  • x(1)=0,

is the logarithm x(t)=\log (t), which is computed by time stepping x = x + \frac{dt}{t} and extended to t>0 by time stepping backwards in time t.

The logarithm x=\log(t) is the inverse of the exponential t=\exp(x).

To do:

1. Play with the code changing into dx=C\frac{dt}{t} with C a given number.

2. Show that by construction

  • \log(a*b)=\log(a) +\log(b).

Hint: Show that if y(t) = \log(a*t)-\log(a), then \frac{dy}{dt}=\frac{a}{a*t}=\frac{dt}{t} (set s = a*t and note that ds = a*dt) and y(t)=0.  Conclude that y(t)=\log(t), that is \log(a*t)-\log(a)=\log(t) and so \log(a*b)=\log(a)+\log(b), choosing t = b.

3. Show that log and exp are inverse functions (use that dx=\frac{dt}{t} is the same as dt=tdx).