MATLAB: How to use taylor series to expand norm function

symbolic

I got a problem when I derived the taylor expansion for norm funtion.
My code
syms q z H q_0 z_0 alpha
f=((abs(q - z)^2)^(1/2)^2+H)^(alpha/2);
tf=taylor(f,[q z],[q_0 z_0],'Order',2);
latex(collect(tf,[q-q_0 z-z_0]))
but matlab throws this wrong message:
错误使用 symengine
Unable to compute a Taylor expansion.
出错 sym/taylor (128 )
tSym = mupadmex('symobj::taylor',f.s,x.s,a.s,options);
出错 derivation (7 )
tf=taylor(f,[q z],[q_0 z_0],'Order',2);
I tried to use (abs(q-z)^2)^(1/2) instead of norm(q-z), unfortunately, it still doesn't work.

Best Answer

One of the conditions for the existence of Taylor series of a function is that the function should be infinitely differentiable. Your function does not fulfill the condition. For example, the following works
syms q z H q_0 z_0 alpha
assume(q>z)
f=((abs(q - z)^2)^(1/2)^2+H)^(alpha/2);
tf=taylor(f,[q z],[q_0 z_0],'Order',2);