If the two numbers have different base, it can be added. But if the exponents are different, it cannot be. Hence, if they have different exponents, just copy the given equation.
Example:
[tex] 2x^2+16x^2=18x^2[/tex] while
[tex] 2x^2+16x^3=(2x^2)+(16x^3)[/tex]