We use partial fractions to find $A$ and $B$ such that:
\[ \simplify[std]{({a*a2+c*a1}*x+{c*b+a*d})/(({a1}x +{b})*({a2}x+{d}))} \;\;\;=\simplify[std]{ A/({a1}x+{b})+B/({a2}x+{d})}\]
Multiplying both sides of the equation by $\displaystyle \simplify[std]{1/( ({a1}x+{b})({a2}x+{d}) )}\;\;$ we obtain:
$\simplify[std]{A*({a2}x+{d})+B*({a1}x+{b}) = {a*a2+c*a1}*x+{a*d+c*b}} \Rightarrow \simplify[std]{({a2}A+{a1}B)*x+{d}*A+{b}*B={a*a2+c*a1}*x+{a*d+c*b}}$
Identifying coefficients:
Constant term: $\simplify[std]{ {d}*A+{b}*B={a*d+c*b} }$
Coefficent $x$: $ \simplify[std]{ {a2}A+{a1}B = {a*a2+c*a1} }$
On solving these equations we obtain $A = \var{a}$ and $B=\var{c}$
Which gives:\[ \simplify[std]{({a*a2+c*a1}*x+{c*b+a*d})/(({a1}x +{b})*({a2}x+{d}))}\;\;= \simplify[std]{{a}/({a1}x+{b})+{c}/({a2}x+{d})}\]