S. C. Newman proves in his book "A Classical introduction to Galois Theory", Chapter 9, Page 154, a lemma by Artin :
I don't understand this "familiar argument" providing that $f\in K^H[x]$. I guess the argument is that $\tau(f(x))=f(x)$ for any $\tau\in H$, but what I can write is :
$$\tau(f(x))=\prod_{\sigma\in H}(\tau(X)-\tau\sigma(\theta))$$
It looks like he uses some magic (or what seems like to me) such as $\tau(X)=X$ for the abstract variable $X$... Can someone explain this step to me please ? The rest is all fine !

Let $a \in K$ and $H.a := \{ \phi(a) | \phi \in H \}$, $H.a$ finite.
Any $\phi \in H$ is a bijection $H.a \rightarrow H.a$, so $$\phi\big(\prod_{b \in H.a}(X-b)\big)=\prod_{b \in H.a}(X-\phi(b))=\prod_{b \in H.a}(X-b)$$ meaning that it is invariant under any $\phi \in H$, because the automorphisms map the roots onto each other bijectively.
Since it is fixed by any $\phi \in H$, every $b$ must lie in $K^H$, so it is a polynomial in $K^H[X]$.