Solve the Diophantine equation.
$6x+ 9y = 15$
We can see that $x = 1$ and $y=1$ solves the equation, so all solutions are given by $x = 1 + 3n$ and $y = 1 - 2n, n \in \mathbb{Z}$. By using:
$$x=x_0 + n \times \frac{b}{gcd(a,b)}$$ and $$y=y_0 - n \times \frac{a}{gcd(a,b)}$$
However, solving it as my textbook says I get:
I get that $gcd(9,6)=3$
$9 = 1 \times 6 + 3$
$6 = 2 \times 3 + 0 $
Then,
$3 = 9 - (1\times 6)$
So,
$3=6(-1) + 9(1) \implies 15 = 6(-5) + 9(5)$
All solutions are given by (as it is stated in my textbook) $$x=x_0 - n \times \frac{b}{gcd(a,b)}$$ and $$y=y_0 + n \times \frac{a}{gcd(a,b)}$$
Thus,
$x = - 5 - 3n$ and $y = 5 + 2n, n \in \mathbb{Z}$
My textbook give the answer as $ x=1+3n, y= 1-2n$, how did they arrive at that by using $$x=x_0 - n \times \frac{b}{gcd(a,b)}$$ and $$y=y_0 + n \times \frac{a}{gcd(a,b)}$$
and $$3=6(-1) + 9(1)?$$
All I get is $x=-1 -3n, y= 1 + 2n,n \in \mathbb{Z}$ which gives $3$ and not $15$, or $x = - 5 - 3n, y = 5 + 2n, n \in \mathbb{Z}$ which gives $15$ but looks ugly. What am I missing?
For any $x_0,y_0$ that are solutions, you can use the formula: $$x=x_0+n\cdot\frac{b}{\gcd(a,b)}\ ,\ y=y_0-n\cdot\frac{a}{\gcd(a,b)}$$ But you can also change the sign, and use the formula like this: $$x=x_0-n\cdot\frac{b}{\gcd(a,b)}\ ,\ y=y_0+n\cdot\frac{a}{\gcd(a,b)}$$ It doesn't matter.
Now, the textbook used $(1,1)=(x_0,y_0)$ and he used the first formula, so he got $x=1+3n\ ,\ y=1-2n$. You used $(-5,5)=(x_0,y_0)$, and the second formula, so you have got $x=-5-3n\ ,\ y=5+2n$, but it's all the same.