# Tag Info

## Hot answers tagged arithmetic

3

The following gives what you intended: Refine[Expand[P[x, y]^2], (x|y|beta) \[Element] Reals] (* ==> Conjugate[z[y]]^2/E^((2*I)*beta*x) + 2*Conjugate[z[y]]*z[y] + E^((2*I)*beta*x)*z[y]^2 *) In cases where you can live with expansion of complex exponentials into Sin and Cos you can also use ComplexExpand[P[x, y]^2, z[y], ...

2

This is a problem for anything that uses machine precision floats, e.g. Mathematica, Matlab, C, etc. Consider the simpler example $1/10$. In base 10, this fraction has the finite decimal expansion $$1/10 = 0.1$$ But your machine would store this number (and all floats) in binary. The problem is, in binary $1/10$ has the infinite decimal expansion  1/10 ...

2

Coefficient[E^(I a (t - b)) // ExpandAll, E^(I a t)] (* Exp[-I a b] *)

Only top voted, non community-wiki answers of a minimum length are eligible