How to solve for a problem using a primitive function in toc
Hint: 

You probably have: 
$$add(0, n) = n$$
$$add(m+1, n) = S(add(m,n))$$

Now you know the base case for addition is adding zero. What's the base case for multiplication? Multiplying by zero.

$$mul(0,n) = 0 $$

I will not do the last part,because you must do your own homework,  look at your example and the addition definition, the $mul$ function must work like this:

$$mul(3,5) \longrightarrow 5 + 5 + 5 + 0 $$