Second derivative with complex numbers
02-09-2021, 06:06 AM (This post was last modified: 02-09-2021 06:08 AM by peacecalc.)
Post: #1
 peacecalc Member Posts: 202 Joined: Dec 2013
Second derivative with complex numbers
Hello all,

I'm shure, in former threads has discussed that topic. After programming the first derivative with complex numbers in my DM42, I tried the same with the second derivative.

For rememberance, the taylor-series for the first derivative (truncating after the first derivative):

$f(x+i\cdot h) \approx f(x) + f'(\tau)|_{\tau = x}\cdot i h \quad \hbox{ take the imaginary part with}\quad \Im(f(x)) = 0 \quad \hbox{ because it is only real, one gets:} \quad f'(x) \approx \frac{1}{h}\Im(f(x+ih))$

Now let us see the taylor series until the second derivative (and then truncating further terms):

$f(x+i\cdot h) \approx f(x) + f'(\tau)|_{\tau = x}\cdot i h + \frac{1}{2} f''(\tau)|_{\tau = x}\cdot (i h)^2 \quad \hbox{with} \quad i^2 = - 1 \Rightarrow f(x+i\cdot h) \approx f(x) + f'(\tau)|_{\tau = x}\cdot i h - \frac{1}{2} f''(\tau)|_{\tau = x}\cdot h^2$
now we take the real part:
$\Re(f(x+i\cdot h)) \approx f(x) - \frac{1}{2} f''(\tau)|_{\tau = x}\cdot h^2 \quad\hbox{the term:} \quad f'(\tau)|_{\tau = x}\cdot i h \quad \hbox{vanish because it is only imagenary and one gets:} \quad f''(x) \approx - \frac{2}{h^2} \cdot \left( \Re(f(x+i\cdot h)) - f(x) \right)$

Maybe it is an advantage, because you only have to calculate one difference instead of three if you calculate the first order derivative without doing that in the complex plane. Please pay attention to, only the real part is taken from f(x+ih).

Sincerely peacecalc
 « Next Oldest | Next Newest »

 Messages In This Thread Second derivative with complex numbers - peacecalc - 02-09-2021 06:06 AM RE: Second derivative with complex numbers - Albert Chan - 02-09-2021, 03:45 PM RE: Second derivative with complex numbers - peacecalc - 02-11-2021, 09:49 AM RE: Second derivative with complex numbers - Werner - 02-11-2021, 12:36 PM RE: Second derivative with complex numbers - Albert Chan - 02-11-2021, 02:13 PM RE: Second derivative with complex numbers - Albert Chan - 02-12-2021, 04:55 PM RE: Second derivative with complex numbers - Werner - 02-11-2021, 05:49 PM RE: Second derivative with complex numbers - Werner - 02-11-2021, 07:01 PM RE: Second derivative with complex numbers - Werner - 02-11-2021, 08:53 PM RE: Second derivative with complex numbers - peacecalc - 02-13-2021, 09:00 AM RE: Second derivative with complex numbers - Werner - 02-13-2021, 02:50 PM

User(s) browsing this thread: 1 Guest(s)