Q:

What is a generalised solution for the Chinese Remainder Theorem? 

I recently read that the system of congruences-
$$x\equiv a_1\pmod {m_1}$$
$$x\equiv a_2\pmod {m_2}$$$$x\equiv a_3\pmod {m_3}$$...$$x\equiv a_k\pmod {m_k}$$
has a solution given by $$\sum_{i=1}^k\frac{m}{m_i}a_i\alpha_i$$
where $m=\prod_{i=1}^k m_i$ and $\alpha$ is a solution ie.$\alpha_1\equiv a_i\pmod{m_i}$.
But,I am having problem in understanding what changes will come up in the solution if I replace the $x$'s in the coefficient to $b_1x$,$b_2x$...$b_kx$ ie if I change the equations into-
$$b_1x\equiv a_1\pmod {m_1}$$$$b_2x\equiv a_1\pmod {m_1}$$...$$b_kx\equiv a_1\pmod {m_1}$$
How will the solution change now? 
Thanks for any help!! 

A:

As a general rule, $bx\equiv a\pmod m$ (when it can be solved) is equivalent to $x\equiv c\pmod {m'}$ for some $c$ and some $m'\mid m$. So it reduces to the first case if there is a solution.  If $b$ and $m$ are relatively prime, then $c=ay$ and $m'=m$, where $mx+by=1$.
If $b_i$ is relatively prime to $m_i$ for all $i$, and the $m_i$ are pairwise relatively prime, then show that $m,\frac{mb_1}{m_1},\frac{mb_2}{m_2},\dots,\frac{mb_k}{m_k}$ are relatively prime, and then solve:
$$m\alpha_0+\sum \frac{mb_i}{m_i}\alpha_i = 1$$
Then let $$x=\sum_{i=1}^{k} \frac{m}{m_i}a_i\alpha_i.$$
Then $$b_ix\equiv \sum_j\frac{mb_i}{m_j}a_j\alpha_i\equiv a_i\frac{mb_i}{m_i}\alpha\equiv a_i\pmod{m_i}$$

