Construct a counterexample of a primary ideal which .... 
Let $A$ be a Noetherian local ring of dimension $d$, $\mathfrak{m}$ its maximal
  ideal. Suppose $\mathfrak{q}=(x_1,\ldots,x_d)$ is an
  $\mathfrak{m}$-primary ideal. Suppose $f(t_1,\ldots,t_d)\in
A[t_1,\ldots,t_d]$ is a homogeneous polynomial of degree $n$ and
  $f(x_1,\ldots,x_d)\in \mathfrak{q}^{n+1}$. Can we conclude that the
  coefficients of $f$ are all in $\mathfrak{q}$? 

Proposition 11.20 in Atiyah's "Introduction to Commutative Algebra"
implies that all the coefficients of $f$ lie in $\mathfrak{m}$. I
wand to check the result can't be strengthen to "all the coefficients
of $f$ lie in $\mathfrak{q}$". So I try to construct some
counterexample, but failed. Let $A=k[x,y]_{(x,y)}$,
$\mathfrak{m}=(x,y)A$. I guess there is  some $\mathfrak{m}$-primary ideal
$\mathfrak{q}$ which generated by two elements, such that the length
$l_{A/\mathfrak{q}}(\mathfrak{q}^n/\mathfrak{q}^{n+1})\neq (n+1)
l_{A/\mathfrak{q}}(A/\mathfrak{q})$ for some $n$. But I don't know how to
find such one. 
Thanks.
 A: You have precisely hit upon the notion of a quasi-regular sequence: if $R$ is a ring, $M$ an $R$-module, $a_1, \ldots, a_n \in R$, and $I = (a_1, \ldots, a_n)$, then the sequence $a_1, \ldots, a_n$ is said to be $M$-quasi-regular if $M \ne IM$, and for any homogeneous polynomial $F \in M[t_1, \ldots, t_n]$ of degree $i$, then $F(a_1, \ldots, a_n) \in I^{i+1}M$ implies the coefficients of $F$ are in $IM$ (where $M[t_1, \ldots, t_n] := M \otimes_R R[t_1, \ldots, t_n]$ are polynomials with coefficients in $M$).
$\newcommand{\q}{\mathfrak{q}}$$\newcommand{\m}{\mathfrak{m}}$
In your case, taking $M = R$, the condition that $\q$ is $\m$-primary guarantees $M \ne \q M$, so your question is whether or not an $\m$-primary ideal generated by $d = \dim R$ many elements (the least possible), is in fact generated by an $R$-quasi-regular sequence. As it turns out, in the local (Noetherian) case, an $R$-quasi-regular sequence is the same as a regular sequence, and a regular sequence of length $d$ exists iff the ring $R$ is Cohen-Macaulay. 
Now, any regular sequence of length $d$ necessarily generates an $\m$-primary ideal. So given your hypotheses, there exists a $\q$ satisfying your conclusion iff $R$ is Cohen-Macaulay. Moreover, if $R$ is Cohen-Macaulay, then any $d$ elements which generate an $\m$-primary ideal (called a system of parameters of $R$) is in fact a regular sequence.
Thus, to give a counterexample, it suffices to take any non-Cohen Macaulay local ring: e.g. $R = k[[x,y,z]]/(x) \cap (y,z) = k[[x,y,z]]/(xy,xz)$. The ideal $\q = (y, x+z)$ is $\m$-primary, but $y, x+z$ is not a regular sequence. Notice that $f(t_1, t_2) = zt_1 \in R[t_1,t_2]$ is homogeneous of degree $1$ and does not have coefficients in $\q$, but $f(y,x+z) = zy = (x+z)y \in \q^2$.
