a-p = (a+p)/b
the answer is p = [a(b-1)] / (b+1) but I don't know how to get from the beginning to the solution.
$\displaystyle a-p = \frac{a+p}{b}$
First remove the fractions:
$\displaystyle b(a-p) = a+p$
Expand:
$\displaystyle ab-bp = a+p$
Move the p to the same side and the other to the other side.
$\displaystyle p + bp = ab - a$
Factorise p and a:
$\displaystyle p(1+b)=a(b-1)$
Divide by (1+b) on both side to have p alone.
$\displaystyle p = \frac{a(b-1)}{1+b}$ or $\displaystyle p = \frac{a(b-1)}{b+1}$