Let $A$ an $R$-ideal, $M$ a submodule generated by $n$ elements, $x \in R$ with $xM \subset AM$. Show that $(x^n+y)M = 0$ for some $y \in A$ 
Let $R$ be a commutative ring, $A$ an ideal in $R$, $M$ an $R$-module generated by $n$ elements, and $x$ an element of $R$ satisfying $xM \subset AM$. Show that $(x^n+y)M=0$ for some $y \in A$.

I am not sure how I would go about this problem, even for the case $n = 1$: Suppose $M = Rm$ for some $m \in  M$. Let $rm \in M$ be an arbitrary element. Then $xrm = ar_1m$ for some $r_1 \in R, a \in A$. Then $(xr-ar_1)m = 0$, with $-ar_1 \in A$. But the problem now is how I would be able to "get rid of" $r$ term of $xr$. How would I be able to do the general case?
 A: Here is the proof from page 21 in Atiyah and MacDonald, or from page 120 of Eisenbud, Commutative Algebra.  It requires some facts about determinants.  Determinants make sense for square matrices over a commutative ring, and the formulas which you may know for determinants of matrices over fields are equally valid in this context.  In particular, for any square matrix $Y$, there is an associated matrix $C(Y)$ called the cofactor matrix with the property that $$C(Y) Y = Y C(Y) = \det(Y) E,$$ where $E$ denotes the identity matrix.  Moreover, $\det(x E - Y) = x^n + y$, where $y$ is in the ideal generated by the entries of $Y$.
Square matrices of size $n$-by-$n$ over $R$ form a non-commutative ring and $M^n$ is a module over this ring, via matrix multiplication.
Suppose that your module $M$ is generated by $m_1, \dots, m_n$. Let $\mathbf m = \begin{bmatrix} m_1 \\ \vdots \\ m_n \end{bmatrix} \in M^n$.
For each $i$, there exist $a_{i, j} \in A$ such that
$$
x m_i = \sum_j a_{i, j} m_j.
$$
Define the matrix $Y = (a_{i, j})$.   Then the previous displayed equation is equivalent to 
$$
(x E - Y)\, \mathbf m = 0.
$$
Multiplying on the left by the cofactor matrix of $x E - Y$, one gets
$\det(x E - Y) E \, \mathbf m = 0$, or $\det(x E - Y) m_i = 0$ for all $i$.  Since the elements $m_i$ generate $M$, this means $\det(x E - Y)M = 0$.  But as observed previously, $\det(x E - Y) = x^n + y$, where $y \in A$. 
