# Example of GCD in UFD that can't be expressed as linear combination

I proved that any two elements in PID have GCD and it can be expressed as linear combination of those two elements. I know that even in case of UFD GCD exists but it may not be expressed as linear combination. Can anyone give me an example for which GCD is not expressed as linear combination?

It is true that in any UFD, any two elements have a GCD (this comes right away from the definition), but the Bezout property (i.e. such a GCD is a linear combination) does not hold in general. Counter-example: in the polynomial ring $\mathbb{Z}[t]$, $2$ and $t$ are coprime, but the ideal $(2,t)$ is strictly contained in the whole ring, whereas it should be equal to it if Bezout were available.
• To clarify: the GCD of $2$ and $t$ is $1$, and the ideal $(1)$ is the entire ring.
Let's consider $R[x,y]$. The GCD of $x^2y$ and $xy^2$ is $xy$ so we are looking for $a,b\in R[x,y]$ such that $ax^2y+bxy^2=xy\Rightarrow ax+by=1$. But the constant term of both $ax$ and $by$ is $0$, so the constant term of their sum is also zero. Contradiction.
In $$ℚ[X,Y]$$ we have $$\gcd (X,Y) = 1$$, but $$1 ≠ fX + gY$$ for any $$f, g ∈ ℚ[X,Y]$$ and both of these assertions can be seen by looking at degrees in $$X$$ and $$Y$$.
$$\operatorname{gcd}(xy, xz) = x$$ but $$x$$ cannot be written as a linear combination of $$xy$$ and $$xz$$.