I define
ψ1 = Sqrt[Subscript[ρ, 1][t]] E^(I Subscript[θ, 1][t]);
ψ2 = Sqrt[Subscript[ρ, 2][t]] E^(I Subscript[θ, 2][t]);
and
eq1 = (I ℏ D[ψ1, t] - U ψ1 - K ψ2)/E^(I Subscript[θ, 1][t]) // FullSimplify
gives
I want to get the imaginary part of the above expression where $\rho$ is positive, and $\theta$ is real.
The result should be
while ComplexExpand gives
How do I do it correctly?






Subscript[ρ, 1][t] > 0andSubscript[ρ, 2][t] > 0, it works as expected – Lukas Lang May 30 '18 at 07:23Subscriptwhile defining symbols (variables).Subscript[x, 1]is not a symbol, but a composite expression whereSubscriptis an operator without built-in meaning. You expect to do $x_1=2$ but you are actually doingSet[Subscript[x, 1], 2]which is to assign a Downvalue to the operatorSubscriptand not an Ownvalue to an indexedxas you may intend. – rhermans May 30 '18 at 08:16