Generalisation of the solution of the inverse Richards' problem