[Verse 1]
When you see ax plus by equals c
There's a question that we need to see
Do integer solutions exist at all?
Here's the rule that will never fall
Find the gcd of a and b
Does it divide c perfectly?
If the answer is yes indeed
Then solutions are guaranteed
[Chorus]
Diophantine, Diophantine
Gcd must divide c for solutions to be
Linear equations with integers true
One solution leads to infinitely new
X equals x-naught plus b over d times t
Y equals y-naught minus a over d times t
Diophantine, Diophantine
That's the pattern that sets you free
[Verse 2]
Start by finding just one pair
X-naught and y-naught living there
Use extended Euclidean way
Or guess and check to save the day
Once you have that special start
All solutions play their part
Parameter t can be any integer
Positive, negative, or zero sir
[Chorus]
Diophantine, Diophantine
Gcd must divide c for solutions to be
Linear equations with integers true
One solution leads to infinitely new
X equals x-naught plus b over d times t
Y equals y-naught minus a over d times t
Diophantine, Diophantine
That's the pattern that sets you free
[Bridge]
D is gcd of a and b
Divides the constant c you see
Without this divisibility
No integer solutions can be
But when it works the magic flows
Infinitely the answer grows
Each value of t gives a new pair
Solutions dancing everywhere
[Chorus]
Diophantine, Diophantine
Gcd must divide c for solutions to be
Linear equations with integers true
One solution leads to infinitely new
X equals x-naught plus b over d times t
Y equals y-naught minus a over d times t
Diophantine, Diophantine
That's the pattern that sets you free
[Outro]
So remember when you see that line
It's a Linear Diophantine
Check divisibility first
Then let the solutions burst