# I integrate a real function, I want a real result [closed]

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 π}]


0. - 13.028165432276161 I

-

## closed as off-topic by Michael E2, m_goldberg, Yves Klett, Leonid Shifrin, RunnyKineMar 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.

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

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


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

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