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 count some integral in Mathematica (actually, check that this integral is zero...) I arrive to an answer which has a zero real part but has some imaginary part! Why? This could be a mistake but I suppose that I am not writting down the commands correctly... What do you think?

r[ϕ_] = 2*(1 - (1/3)^2)/(1 + (1/10) *Cos[ϕ])

Integrate[(Sqrt[(r'[ϕ])^2 + r[ϕ]^2])/(Sqrt[2 (-1 + 1/(r[ϕ]))]), {ϕ, 0, 2 π}]

Mathematica gives the following answer

0.` - 13.028165432276161` I
share|improve this question

closed as off-topic by Michael E2, m_goldberg, Yves Klett, Leonid Shifrin, RunnyKine Mar 23 at 18:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Michael E2, m_goldberg, Yves Klett, Leonid Shifrin, RunnyKine
If this question can be reworded to fit the rules in the help center, please edit the question.

3  
Have a look at Plot[2 (-1 + 1/(r[\[Phi]])), {\[Phi], 0, 2 \[Pi]}]. –  b.gatessucks Mar 23 at 10:56
1  
so it seems you are not integrating a real function... –  chris Mar 23 at 11:08

1 Answer 1

Let's see in detail what the comments are talking about. Define:

r[x_] := 2*(1 - (1/3)^2)/(1 + (1/10)*Cos[x])

Compute function under your integral:

g[x_] = (Sqrt[(r'[x])^2 + r[x]^2])/(Sqrt[2 (-1 + 1/(r[x]))]) // FullSimplify

enter image description here

Plot Im and Re on domain of interest:

Plot[{Re@g[x], Im@g[x]}, {x, 0, 2 Pi}]

enter image description here

So you are indeed basically integrating the imaginary part of the function while its real part is zero.

share|improve this answer

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