In this set of exercises, the solutions are slightly abbreviated. Even so, it is likely that your solution is a subset of the solutions proposed here. The most difficult issue is what happens on failure.
The goal is solved in a very straightforward way. There is no backtracking.
Here, we have a simple case where a failure forces the use of the second half of the definition for b/2.
This is much harder because in trying to solve b(3,Y),c(Y) we have the first subgoal succeed then the second fail twice over before running out of options. We then backtrack to try the remaining option for solving the top level goal which is the subgoal c(3) but this also fails.
A little simpler because no subgoal succeeds at all.