Prove that $x^2+xy$ is odd if and only if x is odd and y is even.

logicsolution-verification

I have a question on proof by cases. I need to prove the statement on title.

First, I can think of proof by contrapositive : x is even and y is odd if and only if $x^2+xy$ is even. Therefore, I let x be even integer and y be odd integer. $x^2+xy$ becomes $2(2k^2+2kl+k)$ where $k,l \in \mathbb{Z}$.
Then, I'm stuck on thinking about other one, but my guess is direct proof, which I can let x be odd integer and y be even integer. I was wondering if I have a right idea or not. Thanks in advance!

Best Answer

Hint:

$$x^2+xy=x(x+y)$$ will be odd $\iff x, x+y$ are both odd

Now as $x$ is odd, $x+y$ will be odd $\iff y$ is even