Derivative, i.e. D[ ] , of Re [ something ]

  • Context: Mathematica 
  • Thread starter Thread starter Swamp Thing
  • Start date Start date
  • Tags Tags
    Derivative
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
Swamp Thing
Insights Author
Messages
1,062
Reaction score
819
TL;DR
Wolfram tries to apply the chain rule and gets stuck simplifying Re'[something]
Consider these two examples:
D[ Re[ Exp[ I*t ] ], t ]
1636515381176.png


D[Re[Exp[I*t]],t] /. t-> 0.5
1636515439574.png


Mathematica seems to get stuck differentiating the "Re[ ]" function after (rather naively) applying the chain rule. This is a trivial example, but we might have a more complicated function defined like :-
myFn [ t _ ]:= Re [(* stuff *)]
... and we would like to find D [ myFn [ t ] ], t] without extra manual reformulation.

How can we do that elegantly and automatically?
 
Last edited:
Physics news on Phys.org
Can either Wolfram or Mathematica do the calculation in two steps? I.e., by first calculating ##Re(e^{it})## and then differentiating that result?
Either of these should be able to simplify ##Re(e^{it})##, which is just ##\cos(t)##.
 
Reply
  • Like
Likes   Reactions: member 428835 and jim mcnamara
Mark44 said:
Can either Wolfram or Mathematica do the calculation in two steps? I.e., by first calculating ##Re(e^{it})## and then differentiating that result?
Either of these should be able to simplify ##Re(e^{it})##, which is just ##\cos(t)##.
I'd do it like this, which worked for me, giving the desired output ##-\sin(t)##:

f[t_] = Exp[I t];
D[ComplexExpand[Re[f[t]]], t]
 
Reply
  • Informative
Likes   Reactions: Swamp Thing