[Date Index] [Thread Index] [Author Index]
RealValued functions and their derivatives
I would be grateful for some help with Alebra`ReIm`. I can declare a function to be real-valued (for real-valued arguments) by <<Algebra`ReIm` RealValued[f]; Then I can ask Mathematica to reason about real and imaginary parts of expressions involving f -- for example Im[t] ^= 0; Im[w] ^= 0; Re[f[t] Exp[I w]] (* correctly returns Cos[w] f[t] *) In my application, I then want to differentiate f. If I naively ask for Re[ f'[t] Exp[I w] ] (* I get Cos[w] Re[f'[t]] - Im[f'[t]] Sin[w] *) Of course, if f is real-valued then f' is real-valued, so I only want the Cos[w] part. If I try to declare f' to be real-valued by RealValued[f'] (* I get an error message: $RecursionLimit::reclim : Recursion depth of 256 exceeded. *) I obviously haven't worked out the right way to tell Mathematica that f' is real-valued. Any suggestions? I'm using Mathematica 4.0. My hack at the moment is to substitute a pure symbol g for f', and to declare that g is RealValued. However, since my function has four arguments and I need derivatives up to order 3, this is very cumbersome. Damon.