A q-rious identity

In the mean-time I have found a proof:

First write Vandermonde’s identity $$\sum_{j=0}^k q^{(k-j)(i+r-j)}\binom{s-r}{k-j}_{q}\binom{i+r}{j}_{q}=\binom{i+s}{k}_{q}$$ in the form $$\sum_{j=0}^k q^{\frac{(j-k)(j-k-1-2r)}{2}}\binom{s-r}{k-j}_{q}q^{\binom{i-j}{2}}\binom{i+r}{j}_{q}=q^{\binom{i-k}{2}}\binom{i+s}{k}_{q}$$ and then replace $s$ by $r-k.$ The elements of the first column of the matrix $$A_{n}=\left(q^\binom{i-j}{2}\left(\binom{i+r}{j}_{q}x+\binom{i+r-j}{j}_{q}\right)\right)_{i,j = 0}^{n - 1} $$ are $q^\binom{i}{2}(x+1).$ By linearity we get $\det{A_n}=(x+1)\det{B_n}$, where the first column of $B_n$ consist of the numbers $q^{\binom{i}{2}}$.
Then by the above identity we can reduce the second column to $q^{\binom{i-1}{2}}\binom{i+r}{1}_{q}(1+x)$ and again factor out $(1+x)$. Iterating this procedure we get $\det{A_n}=(x+1)^n\det{C_n}$ with $C_n= \left(q^\binom{i-j}{2}\binom{i+r}{j}_{q} \right)_{i,j = 0}^{n - 1}$.

To prove $\det{C_n}=1$ observe that $$q^{\binom{i+1-j}{2}}\binom{i+1+r}{j}_{q}-q^{i}q^\binom{i-j}{2}\binom{i+r}{j}_{q}=q^\binom{i-(j-1)}{2}\binom{r+i}{j-1}_{q}.$$ Therefore by subtracting $q^{i}$ times row $i$ from row ${i+1}$ we get that $\det{C_n}= \det{ \begin{pmatrix} 1& * \\ 0 & C_{n-1} \end{pmatrix}}=\dots=1.$


Let $A_n$ be the matrix involved in the problem and let $L_n=\left((-1)^{i-j}\binom{i}{j}_q\right)_{i,j=0}^{n-1}$. Observe that $L_n$ is lower-triangular with 1's in the diagonal. Multiplying, we have: $$L_nA_n=\left(x\,u_{i,j}(r)+u_{i,j}(r-j)\right)_{i,j=0}^{n-1}$$ where $$u_{i,j}(r)=\sum_{k=0}^i(-1)^{i-k}q^{\binom{k-j}{2}}\binom{i}{k}_q\,\binom{k+r}{j}_q\,.$$

Now \begin{eqnarray*} u_{i,j}(r)&=&\sum_{k=0}^i(-1)^{i-k}q^{\binom{k-j}{2}}\binom{i}{i-k}_q\,\binom{k+r}{k+r-j}_q \\ &=&(-1)^{r+i-j}\,q^{\binom{r+1}{2}}\,\sum_{k=0}^i q^{k(k+r-j)}\binom{i}{i-k}_q\,\binom{-j-1}{k+r-j}_q \\ &=&(-1)^{r+i-j}\,q^{\binom{r+1}{2}}\,\sum_{k=0}^i q^{k(k+r-j)}\binom{i}{i-k}_q\,\binom{-j-1}{k+r-j}_q \\ &=&(-1)^{r+i-j}\,q^{\binom{r+1}{2}}\,\binom{i-j-1}{i-j+r}_q =q^{\binom{i-j}{2}}\,\binom{r}{j-i}_q\,. \end{eqnarray*} Hence $u_{i,j}(r)=0$ when $i>j$ and $u_{i,i}(r)=1$. Thus $L_nA_n$ is upper triangular with $x+1$ as elements of the diagonal.