Hilbert series of a tensor product Let $k$ be a field. Let $A,U,V$ be $\mathbb{N}$-graded-commutative $k$-algebras. Suppose there are homogeneous algebra maps $A\rightarrow U$ and $A\rightarrow V$ giving $U$ and $V$ the structure of graded $A$-module, so that the tensor product $U\otimes_AV$ is defined.
Recall that the Hilbert series of a graded $k$-vector space $W=\bigoplus_{i\in\mathbb{N}}W_i$ is $H_W(t)=\sum_{i=0}^\infty\mathrm{dim}_k\;W_it^i$.
My question is the following:

Is there a formula relating the series $H_{U\otimes_AV}(t), H_A(t), H_U(t), H_V(t)$?

I think I can prove that if the maps $A\rightarrow U$ and $A\rightarrow V$ are injective, then

$H_{U\otimes_AV}(t)=\frac{H_U(t)H_V(t)}{H_A(t)}$.

I was wondering if there is a general formula for $H_{U\otimes_AV}(t)$ or if the formula above holds true under more general hypotheses.
 A: (In this answer I will always tacitly require all the graded objects considered to be finite-dimensional in each degree, so that the Hilbert series are defined.)
The formula $$H_{U\otimes_AV}(t)=\frac{H_U(t)H_V(t)}{H_A(t)}$$ is not necessarily true even if the maps $A\to U$ and $A\to V$ are injective.  For instance, consider the case where $A=k[x]/(x^2)$ (with $|x|=1$, say) and $U=V=A\times A/(x)$.  Then $H_A(t)=1+t$ and $H_U(t)=H_V(t)=2+t$ so $$\frac{H_U(t)H_V(t)}{H_A(t)}=\frac{(2+t)^2}{1+t}$$ is not a polynomial, whereas $U\otimes_A V$ is obviously finite-dimensional so its Hilbert series is a polynomial.
What is true is that $$H_{U\otimes_AV}(t)=\frac{H_U(t)H_V(t)}{H_A(t)}$$ if $A$ is connected (i.e., $A_0=k$) and either $U$ or $V$ is flat over $A$ (and it is irrelevant that $U$ and $V$ are algebras; this works for any graded $A$-modules satisfying the necessary finiteness conditions to make the Hilbert series defined).  Indeed, suppose $U$ is flat over $A$. Take a free resolution $$\dots\to F_2\to F_1\to F_0\to V\to 0$$ of $V$ as a graded $A$-module, where each $F_n$ is concentrated in degrees $\geq n$ (this is possible since $A$ is connected, so that you can choose $F_0\to V$ to be injective in degree $0$, and then $F_1\to\ker(F_0\to V)$ to be injective in degree $1$, and so on).  Note that this condition implies that $$H_V(t)=\sum_i(-1)^iH_{F_i}(t),$$ since the resolution is eventually $0$ in each individual degree.  Now tensor this resolution with $U$ to get an exact sequence $$\dots\to U\otimes_A F_2\to U\otimes_A F_1\to U\otimes_A F_0\to U\otimes_A V\to 0.$$
Again, this sequence is eventually $0$ in each individual degree and so $$H_{U\otimes_A V}(t)=\sum_i(-1)^iH_{U\otimes_A F_i}(t).$$  But $H_{U\otimes_A F_i}(t)=\frac{H_U(t)H_{F_i}(t)}{H_A(t)}$ since $F_i$ is free, so $$H_{U\otimes_A V}(t)=\sum_i(-1)^i\frac{H_U(t)H_{F_i}(t)}{H_A(t)}=\frac{H_U(t)}{H_A(t)}\sum_i(-1)^iH_{F_i}(t)=\frac{H_U(t)H_V(t)}{H_A(t)}.$$
More generally, if $U$ is not flat, the sequence $$\dots\to U\otimes_A F_2\to U\otimes_A F_1\to U\otimes_A F_0\to U\otimes_A V\to 0$$ may not be exact but will instead have homology given by $\operatorname{Tor}_i^A(U,V)$ and so we instead would get $$\sum_i (-1)^iH_{\operatorname{Tor}_i^A(U,V)}(t)=\frac{H_U(t)H_V(t)}{H_A(t)}.$$
