Pairs of irreducible fractions that add up to a given irreducible fraction Given the irreducible fraction $\frac a b$, with $a, b \in \mathbb N$, what is the expression that enumerates all the irreducible fractions of integers that add up to $\frac a b$? Namely, an expression (in terms of $a$ and $b$) for all the $\frac c d$ and $\frac e f$, with $c,d,e,f \in \mathbb N$, such that $\frac c d + \frac e f = \frac a b$.
 A: Every couple of fractions $c/a$ and $d/b$ in the Stern-Brocot tree  can be represented (in the inverse notation according to Concrete Mathematics) by the matrix 
${\bf M} = \left\| {\,\begin{array}{*{20}c}
   a & b  \\
   c & d  \\
\end{array}\,} \right\|$, where, iff the fractions are the generators of another fraction in the tree, then the determinant of the matrix $=1$, so that:
$$
a\,d - c\,b = 1\quad  \Rightarrow \quad \left\{ \begin{array}{l}
 \frac{1}{{a\,b}} + \frac{c}{a} = \frac{d}{b}\,\quad  \Rightarrow \quad \frac{c}{a} < \frac{d}{b} \\ 
 \frac{1}{{a\,c}} + \,\frac{b}{a} = \frac{d}{c}\quad  \Rightarrow \quad \frac{b}{a} < \frac{d}{c} \\ 
 \end{array} \right.
$$
So, given $d/b$, it will be equal to a lower-value (left-side)  "co-parent"fraction $c/a$ (determinant $= 1$) plus $1/(ab)$.
Iterating along the tree you get infinite couples, unless you fix a limit on the $1/(ab)$ term.
If that is the case, that is that you fix a maximum denominator, than you may work better on the Farey sequences, arranged on a tree.

Another, geometrical, approach.
Suppose you may fix a upper limit (say $d$) to the denominator of the fractions that shall sum to $a/b$, 
since otherwise their number is infinite, as already seen.
Then, the solutions in the 1st quadrant (octant) to the diophantine linear equation
$$
\frac{x}{d} + \frac{y}{d} = \frac{a}{b}\quad  \Leftrightarrow \quad x + y = \frac{a}{b}d\quad \left| {\;{\rm integers}\;a,b,d,x,y} \right.
$$
will provide all the reduced and un-reduced fractions with denominator $d$.
Their number will clearly be null if $d$ is not a multiple of $b$, 
otherwise it will be equal to $n=ad/b+1$  including the null one ($\left\lceil {n\backslash 2} \right\rceil $).
When we consider the fractions reduced, they will span all the fractions with denominators being a divisor of $d$
$$
\frac{{x_{\,k} }}{{m_k }}\quad \left| \begin{array}{l}
 \;m_k \backslash d \\ 
 \;b\backslash d \\ 
 \end{array} \right.
$$
That is where the connection with Farey sequences comes in.
Now you can plan various choices for $d$, for instance $d=b!$, or $d=b*q!$ …
 '---------  
Examples 
1st approach)
Take the fraction $5/8$: the picture shows a portion of the SB tree around it.

Thus we can write:
$$
{5 \over 8} = \left\{ \matrix{
  {3 \over 5} + {1 \over {40}} = \left( {{4 \over 7} + {1 \over {35}}} \right) + {1 \over {40}} = {4 \over 7} + {3 \over {56}} = \;\left( {{1 \over 2} + {1 \over {14}}} \right) + {3 \over {56}} =  \cdots  \hfill \cr 
  {8 \over {13}} + {1 \over {104}} = \; \cdots  \hfill \cr}  \right.
$$
Note that the fractions that with $5/8$ will generate a new fraction in the tree (are "co-parents" with $5/8$) are those that are adjacent to it (at its level or lower). In our case we shall choose among those adjacent to the left ($3/5$, $8/13$, and lower levels).  
2nd approach)
from
$$
{x \over d} + {y \over d} = {5 \over 8}\quad  \Leftrightarrow \quad x + y = {5 \over 8}d
$$
choosing e.g.
$$
d = 16\;\quad  \Rightarrow \quad x + y = 10
$$
we get
$$
{5 \over 8} = {1 \over {16}} + {9 \over {16}} = {1 \over 8} + {1 \over 2} = {3 \over {16}} + {7 \over {16}} = {1 \over 4} + {3 \over 8} = {5 \over {16}} + {5 \over {16}}
$$
and these are all the fractions with denominator <= 16.
A: The best you can do is simplify your expression:
$$\frac{c}{d} + \frac{e}{f} = \frac{cf + ed}{df} = \frac{a}{b}$$
The numerator and denominator will give you a system of two linear equations. With $a$ and $b$ fixed there are four unknowns $c,d,e,f$. As $4>2$ this means we have infinitely many solutions (as would be expected):
$$a = cf + ed$$
$$b = df$$
Now, with two parameters $T, S \in \mathbb R$ and substituting $c = T, d = S$ (for example):
$$a = Tf + Se$$
$$b = Sf$$
gives you
$$f = \frac{b}{S}$$
$$e = \frac{a - T\frac{b}{S}}{S}$$
$$d = S$$
$$c = T$$
for any real numbers $S, T$.
