Does the Im
function work with symbolic arguments?
Clear[ y, t, k, ω ]
A ( Cos[ k y ] + I Sin[ k y ] ) 2I Sin[ ω t ] //ComplexExpand
(* Output: 2 I A Cos[ k y] Sin[ t ω ] - 2 A Sin[ k y ] Sin[ t ω ] *)
Im[ % ]
(* Output: -2 Im[ A Sin[ k y ] Sin[ t ω ] ] + 2 Re[ A Cos[ k y ] Sin[ t ω ] ] *)
Expected output: -2 A Sin[ k y ] Sin[ t ω ]
ComplexExpand
to the last output again, e.g.ComplexExpand[Im[%]]
instead ofIm[%]
$\endgroup$