In the book Concrete Mathematics, there's an exercise (1.16) where you're asked to solve a general four-parameter recurrence using the Repertoire Method.
The recurrence is defined as follows:
\begin{align*} g(1) &= \alpha;\\ g(2n+j) &= 3g(n)+\gamma n + b_j, \ \ for\ \ j=0,1\ \ and\ \ n\geq 0 \end{align*}
We can show that this can be written on the form: \begin{equation} g(n) = \alpha A(n)+\beta_0 B(n) + \beta_1 C(n) + \gamma D(n) \end{equation}
In the book the solution involves two steps:
1) let $(\alpha, \beta_0, \beta_1, \gamma) = (\alpha, \beta_0, \beta_1, 0)$ then \begin{equation} g(n)=g((b_mb_{m-1}\ldots b_0)_2)=(\alpha \beta_{b_{m-1}}\ldots \beta_{b_0})_3 \end{equation} and therefore \begin{equation} \alpha A(n)+\beta_0 B(n) + \beta_1 C(n) + 0D(n) = (\alpha \beta_{b_{m-1}}\ldots \beta_{b_0})_3 \end{equation}
2) let $g(n) = n$ thus finding values of $\alpha, \beta_0, \beta_1, \gamma$: \begin{align} 1&=\alpha\\ 2n&=3n+\gamma n + \beta_0\\ 2n+1&= 3n+\gamma n + \beta_1 \end{align} give us $(\alpha, \beta_0, \beta_1, \gamma)=(1,0,1,-1)$
and therefore \begin{equation} A(n)+C(n)-D(n) = n \end{equation}
We can therefore write the solution on the form (solving above equation for D(n)): \begin{equation} g(n)=(\alpha \beta_{b_{m-1}}\ldots \beta_{b_0})_3 + \gamma(A(n)+C(n)-n) \end{equation}
After the above steps, the solutions says "hence we know everything" but I don't see how this is a solution to the recurrence as we don't know C(n) nor B(n).
The solution then goes on an says
[Setting $g(n)=1$ gives the additional identity $A(n)-2B(n)-2C(n)=1$, which can be used to define B(n) in terms of the simpler functions A(n) and A(n)+C(n).]
I wonder, how do i find B(n)? And why does it say that I can write it in terms of $A(n)$ and $A(n) + C(n)$
You know that if $n=(b_mb_{m-1}\ldots b_1b_0)_2$, then
$$\alpha A(n)+\beta_0B(n)+\beta_1C(n)=(\alpha \beta_{b_{m-1}}\ldots \beta_{b_0})_3\;,\tag{1}$$
so you know that $A(n)=3^m$. $C(n)$ is the coefficient of $\beta_1$, and $\beta_{b_k}=\beta_1$ precisely when $b_k=1$. The coefficient of $\beta_1$ in $(1)$ is therefore
$$C(n)=\sum_{\substack{0\le k<m\\b_k=1}}3^k=(b_{m-1}\ldots b_1b_0)_3\;.$$
Thus, $A(n)+C(n)=(1b_{m-1}\ldots b_1b_0)_3$.
For the last bit, $A(n)-2B(n)-2C(n)=1$ implies that $2B(n)=A(n)-2C(n)-1$. For convenience let $E(n)=A(n)+C(n)$; then $C(n)=E(n)-A(n)$, so
$$\begin{align*}2B(n)&=A(n)-2C(n)-1\\ &=A(n)-2\big(E(n)-A(n)\big)-1\\ &=3A(n)-2E(n)-1\;, \end{align*}$$
and
$$B(n)=\frac12\big(3A(n)-1\big)-E(n)=\frac{3^{m+1}-1}2-(1b_{m-1}\ldots b_1b_0)_3\;.$$