# Math Help - Numerical differentiation problem?

1. ## Numerical differentiation problem?

xi=[ 0.1 0.2 0.3 0.4 0.5 0.6]

yi=[1.621 1.408 1.266 1.170 1.104 1.060]

What is d ln(yi) / d ln(xi) = ?

2. Originally Posted by chronicals
xi=[ 0.1 0.2 0.3 0.4 0.5 0.6]

yi=[1.621 1.408 1.266 1.170 1.104 1.060]

What is d ln(yi) / d ln(xi) = ?
find the log of each of the xi's and yi's. then use the slope formula to find the derivative. remember, the derivative gives the slope.

3. Originally Posted by Jhevon
find the log of each of the xi's and yi's. then use the slope formula to find the derivative. remember, the derivative gives the slope.
I write this in matlab:

>> x=0.1:0.1:0.6

x =

0.1000 0.2000 0.3000 0.4000 0.5000 0.6000

y=[1.621 1.408 1.266 1.170 1.104 1.060];

>> k=log(y)

k =

0.4830 0.3422 0.2359 0.1570 0.0989 0.0583

>> l=log(x)

l =

-2.3026 -1.6094 -1.2040 -0.9163 -0.6931 -0.5108

and this our result:

>> z=diff(k)./diff(l)

z =

-0.2032 -0.2622 -0.2741 -0.2602 -0.2231

but in my book the result is different:

d ln(y) / d ln (x)= [ -0.246 - -0.249 - -0.2.44 -]

i must reach the book's result, but how?