       Re: ComplexExpand and subscrips

• To: mathgroup at smc.vnet.net
• Subject: [mg109580] Re: ComplexExpand and subscrips
• From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
• Date: Thu, 6 May 2010 04:51:54 -0400 (EDT)

```This is not really anything particularly related to Subscript but rather a
consequence of the following behaviour:

In:== ComplexExpand[Re[f[x]]]
Out== f[x]
In:== ComplexExpand[Re[f[a, x]]]
Out== f[a, x]
In:== ComplexExpand[Re[f[a][x]]]
Out== Re[f[a][x]]

The mathematical justification of this behaviour is not clear to me. In fact, I am not convinced that the first output is justified: ComplexExpand assumes that all variables are real unless stated otherwise, but it is not clear why assuming that x is real implies that f[x] is real for any f. This will only be the case if f is real valued on real numbers (e.g. a holonomic function) but this is not the same as assuming that the variables are real (as stated in the documentation). For some reason this assumption is not made when the function has the form f[a] or f[a,b] and Subscript[f,n] is simply a special case of that.

Andrzej Kozlowski

On 5 May 2010, at 19:06, slawek wrote:

> Why the Out and Out are quite different? The eq is a sample and has
> got no deep meaning.
>
> In:== eq == p1[x] + I p2[x] + Sin[p1[x] - I p2[x]]
> Out== p1[x] + I p2[x] + Sin[p1[x] - I p2[x]]
> In:== Re[eq] // ComplexExpand
> Out== p1[x] + Cosh[p2[x]] Sin[p1[x]]
> In:== eq /. {p1 -> Subscript[p, 1], p2 -> Subscript[p, 2]}
> Out== Sin[Subscript[p, 1][x] - I Subscript[p, 2][x]] + Subscript[p, 1][x]
> + I Subscript[p, 2][x]
> In:== Re[  eq /. {p1 -> Subscript[p, 1],   p2 -> Subscript[p, 2]}] //
> ComplexExpand
> Out== -Im[Subscript[p, 2][x]] + Re[Subscript[p, 1][x]] +
> Cosh[Im[Subscript[p, 1][x]] - Re[Subscript[p, 2][x]]] Sin[Im[Subscript[p,
> 2][x]] + Re[Subscript[p, 1][x]]]
>
> TIA
> slawek
>
>
>

```

• Prev by Date: Re: Parallelize NonlinearModelFit
• Next by Date: Re: Return intermediate reference using Hold*****?
• Previous by thread: ComplexExpand and subscrips
• Next by thread: Re: ComplexExpand and subscrips