What is the reason behind the demand function of a perfect complement good? so I know that usually the income curve is equal to:
$$x_1p_1 + x_2p_2 = m$$
if we rearrange this equation we get that the demand for good one ($x_1$) is equal to:
$$x_1 = \frac{m-x_2p_2}{p_1}$$

None the less in my book it is said that:


  The demand for good 1 is $x_1 = \frac {m}{(p_1 + p_2)}$


if anyone could explain me why $x_1 = \frac {m}{(p_1 + p_2)}$ instead of $x_1 = \frac{m-x_2p_2}{p_1}$ that would be greatly appreciated. many thanks in advance.
Suppose you have $M=20$ to spend on shoes. Left shoes cost $p_L=5$ and right shoes cost $p_R=5$. A bundle, $(x_L,x_R)$ consists of $x_L$ pairs of left shoes and $x_R$ pairs of right shoes.

How would you figure out how many of each type of shoe to buy? Probably the reasoning would go like this:


You only ever want to buy shoes in pairs (consisting of a left and a right shoe). So instead of asking how many left shoes and right shoes to buy, you can define a new good called "pairs of shoes" and ask how many units of this new good to buy.
The price of a pair is $p_P=p_L+p_R=10$. Thus, you can afford to buy up to $\frac{M}{p_P}=\frac{M}{p_L+p_R}$ pairs (two pairs in our example).
Since you need one left shoe to make each pair, the number of left shoes you buy is simply the same as the number of pairs calculated in step 2: $x_L=\frac{M}{p_L+p_R}$, or two left shoes. Likewise, you need to buy $x_R=\frac{M}{p_L+p_R}$ right shoes.