Symbolic Taylor expansion
I would like to expand the symbol function f as a Taylor series δf(x)=δxddxf+12(δx)2d2dx2f+O((δx)3) with δx=a1(δt)12+a2(δt)+a3(δt)32+O((δt)2) and expand and collect the same power terms of δt up to a designated power, say, 32. f is just a symbol, I just need Mathsage to produce the symbols of derivatives ddx.
How should one set this up?
Inspired by eric_g's answer to this question, I am able to perform the same operation to f(x,y) with δy=a1(δs)12+a2(δs)+a3(δs)32+O((δs)2). I would like to collect terms according to the powers dti2dsj2 where i and j are nonnegative integers and arranged in the ascending order of i+j. I would also like to have the capacity to collect terms according to the order of some other variables, say, a1. I have tried using
g.full_simplify().maxima_methods().collectterms(dt)
for a single variable dt. But it does not seem to work well for the fractional power. I do not know if it will work for dti2dsj2.
How can I set this up?