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?
I'm not 100% sure I understand what you want, but here's my suggestion for what I think you want:
Define f(z):
f := z -> whatever f does with z;
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.