Let us consider a fraction, $f = \frac{a*x + b}{c*x + d}$, for some integers $a, b, c, d$ and positive interger $x$. We say that fraction, $f$ is good for given value of $(a, b, c, d)$ if for all positive $x$, it is always irreducible i.e. $gcd(ax+b, cx+d) = 1$, where gcd = Greatest common divisor.
We need to find the conditions to be satisfied by the tuple $(a, b, c, d)$, so that $f$ is a good fraction.
My approach to the problem :
Extended Euclid algorithm applies to Polynomials too. So, we want $U(x)$ adn $V(x)$ such that :
$U(x) * (a*x + b) + V(x) * (c*x + d) = 1 \dots (1)$
Degree$(U(x)) <$ Degree$(c*x + d)$ - Degree$(1)$
implies Degree$(U(x)) = 0$
Similarly for $V(x)$.
So equation $(1)$ reduces to $U * (a*x + b) + V * (c*x + d) = 1$, for some rational numbers $U$ and $V$.
Comparing Coefficient of $x$ and $constant$ on both sides of the equation, we get :
$U * a + V * c = 0 \dots (2)$
$U * b + V * d = 1 \dots (3)$
Now, equation $2$ and $3$ can't be written as linear combination of each other, so infinite solutions doesn't exist. So, for a unique solution to exist, we want $(a * d - b * c) \neq 0$.
But this condition is not the only one required as I found counter-examples (eg: $(a, b, c, d) = (2, 2, 3, 5)$, the fraction $f$ is not good for $x = 1$, although $(2 * 5 - 2 * 3 \neq 0$)).
I am struck while solving this problem.
Could anyone please provide hints/solutions to the above problem. Also, if there is any mistake in my above approach, please mention it to.
Thanks in advance.
Partial answer If $\frac{a x + b}{c x + d}$ is not irreductible for some $x$, let $p$ be a prime common divisor of $a x + b$ and $c x + d$, then $$ p | a (c x + d) - c (a x + b) = a d - b c $$
It follows from this that if $a d - b c = \pm 1$, the fraction is good.
Unfortunately, @cr001's counter-example in the comments show that this condition is not necessary.
Suppose, however that the fraction is good. Let $p$ be a prime factor of $a d - b c$. Then we claim that p divides $a$ and $c$. Indeed, suppose for example that $p$ does not divide $a$, we can find $x>0$ such that $a x + b\equiv 0\ [p]$ because $a$ is invertible modulo $p$. Now we have $a(cx + d) \equiv a c x + b c\equiv c(a x + b)\equiv 0 \ [p]$. It follows that $c x+ d \equiv 0\ [p]$ and the fraction is not good, a contradiction. The same proof shows that $p$ divides $c$.