Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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  π}]
share|improve this question
1  
There are two errors in your code: functions are defined with := and Series requires a symbol as a variable. –  Hector Mar 21 at 23:38

1 Answer 1

up vote 3 down vote accepted

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) *)
share|improve this answer
    
Thanks a lot! I now know how to use the "Normal". –  Lawerance Mar 22 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. –  David Skulsky Mar 30 at 17:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.