# Evaluate integral of a series

I want to evaluate this integral, but it won't work. Does anyone knows why?

Remove["Global*"]

dm = (M/(2 π a)) a ;

i[ϵ_] = 1/(a Sqrt[1 - 2 (ϵ) Cos[θ] + (ϵ)^2]);
i1[ϵ_] = Series[i[ϵ], {ϵ, 0, 1}];
invertdist[r_] = i1[a/r];

ϕ[r_] = -Integrate[G dm invertdist[r], {θ, 0, 2  π}]

-
There are two errors in your code: functions are defined with := and Series requires a symbol as a variable. – Hector Mar 21 '14 at 23:38

The only thing wrong with your code is that Series doesn't return an expression suitable for evaluation at specific values of the expansion variable. You first have to convert the SeriesData object to a normal expression using Normal. This is the only change needed:

i1[ϵ_] = Normal[Series[i[ϵ], {ϵ, 0, 1}]];


With this, the integration works as expected:

ϕ[r_] = -Integrate[G dm invertdist[r], {θ, 0, 2 Pi}]

(* ==> -((G M)/a) *)
`
-
Thanks a lot! I now know how to use the "Normal". – Lawerance Mar 22 '14 at 20:10
@Lawerance: if you are satisfied with the answer you received from Jens (and it seems you are), then please Accept his answer. – Cassini Mar 30 '14 at 17:05