2

I am struggling with an extension of using a working pattern used as Assumptions for Simplify and the like. Consider this:

Simplify[Conjugate[f[1][t]]]
Simplify[Conjugate[f[1][t]], Assumptions -> Element[f[__][t], Reals]]
(* Conjugate[f[1][t]] *)
(*f[1][t] *)

As intended, the pattern causes f[1][t] to be treated as real. However, there are also derivatives of f[1][t] appearing which are also real. Unfortunately, a similar idea as above does not work:

Simplify[Conjugate[D[f[1][t], {t, 2}]], Assumptions -> Element[D[f[__][t], {t, __}], Reals]]
(* Conjugate[f[1]''[t]] *)

Is it possible (if so, how) to use a pattern that also allows me to treat all derivatives of arbitrary order as real? Actually I would expect Mathematica to already do this, if it knows that the function that is derived is real...

Lukas
  • 2,702
  • 1
  • 13
  • 20

1 Answers1

3

The pattern you need is different than what you enter. Your code actually evaluates the pattern:

Assumptions -> Element[D[f[__][t], {t, __}], Reals] // Trace

{{{HoldForm[D[f[__][t], {t, __}]], HoldForm[__!*Piecewise[{{__, __ == 0}}, 0]]}, HoldForm[Element[__!*Piecewise[{{__, __ == 0}}, 0], Reals]]}, HoldForm[Assumptions -> Element[__!*Piecewise[{{__, __ == 0}}, 0], Reals]], HoldForm[Assumptions -> Element[__!*Piecewise[{{__, __ == 0}}, 0], Reals]]}

What you need is

Assumptions -> Element[Derivative[_][f[__]][t], Reals] // Trace

{HoldForm[Assumptions -> Element[Derivative[_][f[__]][t], Reals]], HoldForm[Assumptions -> Element[Derivative[_][f[__]][t], Reals]]}

With this, you expression evaluates as expected:

Simplify[Conjugate[D[f[1][t], {t, 2}]], 
 Assumptions -> Element[Derivative[_][f[__]][t], Reals]]

f[1]′′[t]

Stitch
  • 4,205
  • 1
  • 12
  • 28
  • Ah right! Now I remember that I encountered a very similar issue a while ago, but didn't think of it anymore. Thank you very much for pointing this out! – Lukas Apr 26 '17 at 15:23