Suppose I want to construct a function $h(x,r)$ such that it exhibits a bifurcation of type $a$ at the point $(x_{1},r_{1})$ and bifurcation of type $b$ at the point $(x_{2},r_{2})$.
One alogirhtm to find this is to set all the relevant derivatives equal to zero, using the two taylor expansions, and go from there. This gets complicated quite fast, specially when done by hand.
As a first attempt, I tried doing the following:
let $f$ have a bifurcation of type $(a)$ at point $(x_{1},r_{1})$, and $g$ have a bifurcation of type $(b)$ at point $(x_{2},r_{2})$. Then if $h = f+g$, we might be in luck, since locally $h$ behaves like $g$ at $(x_{1},r_{1})$ and similarly for $f$. But this turned out not to work:
This plot shows that we don't get the desired bifurcation.
Experimentally, I tried $fg$ instead. 
And at least in the one example I tried, this seemed to work. There are the bifurcations of the desired type in the desired positions.
How can I generalize this result, and what is the theoretical justification of $fg$ exhibiting the desired bifurcation behavior?

This is essentially due to the fact that bifurcations are determined by the zeros of the RHS function in an ODE $x'=f(x)$. It's not easy to relate the zeros of the sum of polynomials (or any other kinds of functions) to the sum of the zeros of the polynomials (e.g. consider $p(x)=x-1, q(x)=x$. Then $x=1$ is the unique zero of $p$ and $0$ is the unique zero of $q$, but $p+q=1$ has no zero.); while any zero of a product ought to be a zero of one component.
For completeness here is an alternative implementation of a combination of a saddle-node bifurcation and pitchfork bifurcation, which also records the stability properties:
(Here is the link to the interactive graph: https://www.desmos.com/calculator/0fb2kpdner)