Proof that $\sqrt2$ is not in $Q(\pi)$ I am trying to understand why  $\sqrt2$ is not in $Q(\pi)$. The solution is posted below:

So I understand the first part because a transcendental extension is isomorphic with the field of fractions so that makes sense. However, I don't understand the part after that. Why must $m=n$? What happens if they're not equal?
 A: $$
2b_n^2 \pi^{2n} = a_m^2\pi^{2m}
$$
$$
2b_n^2 \pi^{2(n-m)} - a_m^2=0
$$
This would be a polynomial with rational coefficients having $\pi$ as one of its zeros. That would mean $\pi$ is algebraic.
A: This is based on my comments and I want to post it as an answer because this aspect has been overlooked by other answers.
Any element of $\mathbb {Q} (\pi) $ is of the form $f(\pi) /g(\pi) $ where $f(x), g(x) \in\mathbb {Q} [x]$. If this equals $\sqrt{2}$ then we have $$2g^2(\pi)=f^2(\pi)$$ and the above is an equality between two real numbers. From here we can't start comparing coefficients as if they are polynomials in some variable.
Rather the above equation shows that $\pi$ is a root of the polynomial $h(x) =2g^2(x)-f^2(x)$. Thus $h(x) $ must be the zero polynomial and then we need to start comparing degree of $f, g$ and equate coefficients. You should be able to derive a contradiction easily by first showing that degree of $f$ must equal that of $g$ and then comparing coefficients.

More generally if $a$ is algebraic and $b$ is transcendental then $a\in\mathbb {Q} (b)$ iff $a\in\mathbb {Q} $. We can assume $a=f(b) /g(b) $ where $f(x), g(x) \in\mathbb {Q} [x] $ and $g$ is non-zero polynomial.
Then $b$ is the root of the polynomial $h(x) =ag(x) - f(x) \in\mathbb {Q} (a) [x] $. The above polynomial is a non-zero polynomial if degree of $f$ is different from that of $g$. And then $b$ becomes algebraic and we reach a contradiction. Hence the degree of $f, g$ must be same and let $p, q$ be their leading coefficients. If $aq-p\neq 0$ then again the polynomial $h$ is non-zero and we get that $b$ is algebraic. Hence we must have $qa=p$ so that $a=p/q$ is rational.
In the above proof we have used the fact that the roots of a polynomial with algebraic coefficients are also algebraic.
A: Recall that $\pi$ is transcendental over $\mathbb Q$, meaning that $\{\pi^k:k\in\mathbb N\}$ is a $\mathbb Q$-linearly independent subset of $\mathbb R$.
Now, suppose that $a_m$ and $b_n$ are non-zero; otherwise, take non-zero polynomials $p,q \in \mathbb Q[x]$ with minimal degrees such that $\sqrt2 = p(\pi)/q(\pi)$.
If $m \neq n$, then $\pi^{2n}$ and $\pi^{2m}$ are $\mathbb Q$-linearly independent, so that $$2b_n^2\pi^{2n}-a_m^2\pi^{2m}=0 \implies 2b_n^2=0=-a_m^2 \implies b_n=0=a_n.$$
