I have defined several custom analytic functions. Here is the simplest example:
ln[x_, a_?NumericQ] := Piecewise[{{Log[x], Re[a] > 0}, {-Log[1/x], True}}]
Now I would like to let Mathematica know how to carry out derivatives on this: I need to make D
and Series
work on ln
as if it were Log
:
ln /: D[ln[f_, g_], x_] := D[Log[f], x];
Works wonderfully:
But Series
doesn't work because it is using Derivative
instead of D
.
So, now I try TagSetDelayed
on Derivative
:
But as you can see, it doesn't work because ln
is too deep. What can I do to make Series
work?
Series
didn't simplify with your definition forD
, then it's because you didn't defineln
for symbolica
. That's why I used a numerica
in my answer in the series. $\endgroup$