How to check if a commutative ring is Gorenstein. Suppose I have a ring $R$ defined by generators and relations;
for example,
$ C [A, b_0, b_1, b_2, b_3]$
with relations


*

*$b_2*A-b_1*b_0=0$,

*$b_3*A-b_1*b_2=0$,

*$b_2^2-b_0*b_3=0$.



Using Macaulay2 package "Depth" I'm able to check if ring is Cohen-Macaulay, but I also need to compute for example $Ext^3_R(C, R)$. Only package I found for counting Ext's (namely Ext ) does it only for complete intersections (which are already Gorenstein). Is there a way to check if a commutative ring is Gorenstein?
 A: Macaulay2, version 1.3.1
i1 : S = QQ[A,b0,b1,b2,b3]

o1 = S

o1 : PolynomialRing

i2 : I=ideal(b2*A-b1*b0, b3*A-b1*b2, b2^2-b0*b3)

                                              2
o2 = ideal (- b0*b1 + A*b2, - b1*b2 + A*b3, b2  - b0*b3)

o2 : Ideal of S

i3 : R = S/I

o3 = R

o3 : QuotientRing

i4 : k = coker vars R

o4 = cokernel | A b0 b1 b2 b3 |

                            1
o4 : R-module, quotient of R

i5 : Ext^3(k,R^1)

o5 = cokernel {-2} | b3 b2 b1 b0 A 0  0  0  0  0 |
              {-2} | 0  0  0  0  0 b3 b2 b1 b0 A |

                            2
o5 : R-module, quotient of R

Socle dimension 2. Not Gorenstein.
Alternative method: find a regular sequence of length 3 and kill it. Here's one found by trial and error:
i27 : J=ideal (b1 - b2, A, b0 - b3)

o27 = ideal (b1 - b2, A, b0 - b3)

o27 : Ideal of R

i28 : res J

       1      3      3      1
o28 = R  <-- R  <-- R  <-- R  <-- 0

      0      1      2      3      4

o28 : ChainComplex

i29 : T = R/J

o29 = T

o29 : QuotientRing

i31 : Hom(coker vars T,T^1)

o31 = image | b3 b2 |

                              1
o31 : T-module, submodule of T

i32 : prune oo

o32 = cokernel {1} | b3 b2 0  0  |
               {1} | 0  0  b3 b2 |

A: Here is an alternative way to think about this without Macaulay. 
Clearly, your equations look like $2\times 2$ determinants. In fact, sure enough, these are all the $2\times 2$ minors of the matrix:
$$
\left[
\begin{matrix}
A & b_0 & b_2 \\\
b_1 & b_2 & b_3 
\end{matrix}
\right].
$$
So $\mathrm{Spec}\, R$ is a hypersurface in the cone $C\subset \mathbb A^6$ over the Segre embedding of $P=\mathbb P^2\times\mathbb P^1\hookrightarrow \mathbb P^5$. Therefore, $R$ is Gorenstein if and only if $C$ is, but $C$ isn't.
To see the latter note that being Gorenstein is equivalent to being Cohen-Macaulay and the dualizing sheaf being a line bundle (or perhaps you would prefer to say that the dualizing module is locally principal). 
It is relatively easy to see that the dualizing sheaf of $C$ is not a line bundle. Since its an affine cone over a normal (actually smooth) projective variety, $\mathrm{Pic}\, C$ is trivial. Hence if 
the dualizing sheaf of $C$ were a line bundle it would be trivial. Then the dualizing sheaf of its projective closure in $\mathbb P^6$ would be also a line bundle, which as a divisor is supported at the hyperplane at infinity. That would imply that the dualizing sheaf of the original variety $P=\mathbb P^2\times\mathbb P^1$ is a multiple of the restriction of the hyperplane class of $\mathbb P^5$, but it is not, because it is the class $(-3,-2)$, whereas the hyperplane class is $(1,1)$. 
Notice that this approach actually proves that this is not even $\mathbb Q$-Gorenstein, that is, that no (reflexive) power of the dualizing sheaf of $C$ is a line bundle. It is also clear, although this is probably easy to see from the ring already that the only localization that is not Gorenstein is at the vertex of the cone and all localizations at primes that are not contained in that maximal ideal are regular. Finally, it is also easy to see this way that $R$ is Cohen-Macaulay. It follows by figuring out the cohomology of powers of the hyperplane class of the embedding on $P$. 
