Why Series calculating the derivatives of user-defined function instead of terms of that function

I defined below functions which are power series of t.

I need to have the solution of first[t_] as power series of t.

I know it is because of the Taylor expansion. But I need the answer in terms of terms of my function , not derivatives !

h[t_] = h[0] + t^2*h[2] + t^3*h[3] + t^4*h[4] + t^5*h[5] + O[t]^6;

m[t_] = m[0] + t^2 *m[2] + t^3 *m[3] + t^4 *m[4] + t^5 *m[5] + O[t]^6;

aa[t_] = t^2 * a[2] + t^3*a[3] + t^4* a[4] + t^5*a[5] + t^6*a[6] + O[t]^7 ;

cc[t_] = 1/2*(1 - 1/k*(m[t]));

divid[t_] = Series[(h[t] + (1 - b)*m[t])^2, {t, 0, 4}]

denomi[t_] = 4*Sqrt[k] *Series[(aa[t])^(3/2), {t, 0, 5}]

first[t_] = Series[(divid[t]/denomi[t]), {t, 0, 1}]


The answer of first[t_] should be in terms of say a[2], a[3], h[3], m[3], .... However, I get divid[0]' , divid[0], denom[0], denom[0]''...

Also, I do not think that it is because of the division of two functions, sometime I get the same baheviour when I run divid or denomi.. Any help will be appreciated. Thanks.

It works for me by using the function definitions below:

hh[t_] := h[0] + t^2*h[2] + t^3*h[3] + t^4*h[4] + t^5*h[5] + O[t]^6;

mm[t_] := m[0] + t^2*m[2] + t^3*m[3] + t^4*m[4] + t^5*m[5] + O[t]^6;

aa[t_] :=
t^2*a[2] + t^3*a[3] + t^4*a[4] + t^5*a[5] + t^6*a[6] + O[t]^7;

cc[t_] := 1/2*(1 - 1/k*(mm[t]));

divid[t_] := Series[(hh[t] + (1 - b)*mm[t])^2, {t, 0, 4}]

denomi[t_] := 4*Sqrt[k]*Series[(aa[t])^(3/2), {t, 0, 5}]

first[t_] := Series[(divid[t]/denomi[t]), {t, 0, 1}]


Example:

In[8]:= first[t]
Out[8]= (h[0]+m[0]-b m[0])^2/(4 Sqrt[k] a[2]^(3/2) t^3)-(3 (a[3] (h[0]+m[0]-b m[0])^2))/(8 (Sqrt[k] a[2]^(5/2)) t^2)+((((15 a[3]^2)/(8 a[2]^2)-(3 a[4])/(2 a[2])) (h[0]+(1-b) m[0])^2)/(4 Sqrt[k] a[2]^(3/2))+((h[0]+(1-b) m[0]) (h[2]+(1-b) m[2]))/(2 Sqrt[k] a[2]^(3/2)))/t+O[t]^0


The renaming is for avoiding infinit recursions.

• @Meva, Armin used := where you have = in your definitions. – N.J.Evans Oct 10 '16 at 13:09
• Thanks @ N.J.Evans , however, I still get derivatives. Nothing has changed. – Meva Oct 10 '16 at 13:13
• Also, I am not sure I understand why the function needs to have delayed definition . – Meva Oct 10 '16 at 13:23
• Guys, thank you both. My code works now. @Armin , you have changed the function definitions and it worked! – Meva Oct 10 '16 at 14:13