I am a beginner of Mathematica. Now I need to rewrite one function f(u,p,r) in the format of h1(p)u^2+[h4(p)r+h5(p)]u+h6(p)r^3+h7(p)r^2+h8(p)r+h9(p). It is known that f(u,p,r) could be rewrite in the format above. I tried to use expand and collect, but I cannot rewrite the f(u,p,r) in that format.
It is not quite clear what you are wanting. Are you wanting to create a Taylor expansion of the function? If so the following tutorial should help get you started on that:
http://reference.wolfram.com/language/tutorial/MakingPowerSeriesExpansions.html