How to multiply and reduce ideals in quadratic number ring. I am studying quadratic number rings and I have a problem with multiplying and reducing ideals, for example:

Let $w=\sqrt{-14}$. Let $a=(5+w,2+w)$, $b=(4+w,2-w)$ be ideals in $\mathbb Z[w]$. Now, allegedly, the product of ideals $a$ and $b$ in $\mathbb Z[w]$ is $(6,3w)$. Please explain clearly, how to get to $(6,3w)$.


I have a script written with the GAP system that does things like this :    
product:=function ( I, J )
    local  car, pr;
    car := Cartesian( I, J );
    pr := List( car, Product );
    pr := List( pr, coeff );
    pr := BaseIntMat( pr );
    return Basis( Nf, List( pr, v->v * B));
end    
Here I and J are two bases for the ring of integers. The script makes all possible products and selects a minimum number of vectors as a basis for the vector space spanned by the products (and such that the coefficients of these product have integer coefficients in this basis). This is done by the built-in function BaseIntMat.
