Rella
Rella

Reputation: 66965

Maple: How having f(z) create f'(z), where z is complex variable?

So I have f(z), z:= a + I*b I want to create f`(z) capable of working with my z.

First time I tried fd:= diff(f(z), z) but my code fails with Error, (in fd) invalid input: diff received a+I*b, which is not valid for its 2nd argument.

So only solution I found is to create f' in 2 steps. Calculate diff(f(z), z) into some variable and copy output by hand into fd:= z-> ...copied stuff...

So what would be correct solution for such problem - how to get rid of manual copying?

Upvotes: 0

Views: 196

Answers (1)

jmbr
jmbr

Reputation: 3348

I'm not 100% sure I understand what you want, but here's my suggestion for what I think you want:

  1. Define f(z):

    f := z -> whatever f does with z;

  2. Define the derivative df(z):

    df := D(f);

Now, if f := z -> z^2, then df(a + b*I) will evaluate to 2*a + 2*b*I.

I hope this helps.

Upvotes: 2

Related Questions