Let $E \subseteq \mathbb{R}^n$ be an open set. Suppose
$$P,Q: E \to \mathbb{R}$$ are polynomial functions in several variables. For example
$$P(x,y) = x^2y + x + y^2 +1$$
Suppose $Q$ is identically non-zero on $E$. I want to prove that
$$F: E \to \mathbb{R}: x \mapsto \frac{P(x)}{Q(x)}$$ is a $C^\infty$ map.
My attempt:
Using induction, it is easy to prove that the sum and product of $C^k$ functions remain $C^k$.
We now prove that the same is true for quotients. I.e., suppose that $f,g: E \to \mathbb{R}$ are $C^k$ functions, $g$ is $0$ nowhere. Then $f/g$ is also a $C^k$ function.
For $k=1$, we have $D_i(f/g)(x) = \frac{D_i f(x) g(x)- f(x)D_ig(x)}{g(x)^2}$ and we see that $D_i(f/g)$ exists and is continuous on $E$.
Suppose the statement holds for $k-1$ and suppose $f,g \in C^k$. Then $D_i f,D_ig, f,g$ are $C^{k-1}$ and because the sum and product of $C^{k-1}$ functions is $C^{k-1}$, we have $D_if g - fD_ig$ is of class $C^{k-1}$ and $g^2$ is of class $C^{k-1}$. Hence, the quotient $D_i(f/g)\frac{D_ifg - fD_ig}{g^2}$ is $C^{k-1}$, meaning that $f/g$ is of class $C^k$.
Now, if $k= \infty$, then $f,g$ are of class $C^l$ for every l, and hence $f/g$ is of class $C^l$ for every $l$, meaning that $f/g$ is of class $C^\infty$.
Now, the statement that I want to prove follows because $P,Q$ are smooth functions, because they are polynomials and the partial derivatives remain differentiable and continuous.
Is my attempt correct?