We generalize the Malgrange preparation theorem to matrix valued functions F(t,x) is-an-element-of C(infinity)(R x R(n)) satisfying the condition that t --> detF(t,0) vanishes to finite order at t = 0. Then we can factor F(t, x) = C(t, x)P(t, x) near (0, 0), where C(t, x) is-an-element-of C(infinity) is inversible and P(t, x) is polynomial function of t depending C(infinity) on x. The preparation is (essentially) unique, up to functions vanishing to infinite order at x = 0, if we impose some additional conditions on P(t, x). We also have a generalization of the division theorem and analytic versions generalizing the Weierstrass preparation and division theorems.