Q1:
I need to simplify some algebraic expression, according to particular pattern, namely:
\begin{equation*} x^m = \left\{ \begin{array}{ll} 1 & \text{if } m \text{ is even} \\ x & \text{if } m \text{ is odd} \end{array}\right. \end{equation*}
for example:
$$ a x^3 + b x y-c x^7 y^2 $$ should be simplified to $$ ax + bxy - cxy^2 $$ I need something like:
a x^3 + b x y - c x^7 y^2 /.{x^_ -> ... }
but, that will recognize the parity of the each power in the expression.
Q2:
How one can get only one term in the sum? For example, in the example there are three terms
$$ a x^3, \ b x y, \ -c x^7 y^2 $$
is there any possibility to decompose the full expression to
A = {a x^3, b x y, - c x^7 y^2}