You could also construct M as

```
Ps=Matrix(1,3,lambda i, j: P(x0 +j*h,x0,c,n))
C=Matrix(c)
M=Ps.jacobian(C)
```