I want to do definite integration of the following expression

expr=(4*θ*Sqrt[1/(1 + (4*Cos[θ])/169)]*Cos[θ]*
   Sqrt[(-4*Sqrt[1/(1 + (4*Cos[θ])/169)]*Sin[θ] + 
       (8/169)*(1/(1 + (4*Cos[θ])/169))^(3/2)*Cos[θ]*Sin[θ])^2 + 
     (4*Sqrt[1/(1 + (4*Cos[θ])/169)]*Cos[θ] + 
       (8/169)*(1/(1 + (4*Cos[θ])/169))^(3/2)*Sin[θ]^2)^2])/
  (9/4 + (16*Cos[θ]^2)/(1 + (4*Cos[θ])/169) + 
    (16*Sin[θ]^2)/(1 + (4*Cos[θ])/169))^(3/2)

But when I do Integrate[expr,{θ,0,2*Pi}] it just goes on and on and dont stop in 5 mins. The expr is smooth on the whole interval of integration. Here is the plot.

Plot[expr, {θ, 0, 2*Pi}]

enter image description here

Please tell me what could be the reason of such behavior of Mathematica? How do I properly integrate this expression? Maybe the only way is to do NIntegrate[]? And how one knows if the expression can be integrated symbolically?

  • $\begingroup$ It seems unlikely that this would have a simple symbolic result. Wouldn't a numerical one do? $\endgroup$ – Szabolcs Jun 23 '16 at 13:39
  • $\begingroup$ @Szabolcs in Mapple it gives the symbolic result very fast. So there should be one. Maybe I need to use some options in Integrate[] function?NIntegrate[] gives the expected result, but I need the symbolic one. $\endgroup$ – Mr Bubble Hubble Jun 23 '16 at 13:41
  • 1
    $\begingroup$ @Szabolcs sry, my bad. Maple doesnt give the symbolic result. Maybe u are right. I will edit my question now. $\endgroup$ – Mr Bubble Hubble Jun 23 '16 at 13:48
  • $\begingroup$ I was just about to say, I've tried running the integration on python, and it doesn't do any better than Mathematica. $\endgroup$ – Feyre Jun 23 '16 at 14:01
  • $\begingroup$ @Feyre ty, I think it can be calculated only numerically. $\endgroup$ – Mr Bubble Hubble Jun 23 '16 at 14:04
NIntegrate[expr,{\[Theta],0,2*Pi}]// Timing

{0.008, 0.0151049}

When you integrating it within a limit, it will always give you a number, not a function. Now, say you are interested in finding the integration as a function of the upper limit. In that case you can get an InterpolatingFunction which you can use in any further calculation.

data = Table[{x, NIntegrate[expr, {\[Theta], 0, x}]}, {x, 0., 4 Pi, Pi/50.}];
f[x_] = Interpolation[data][x]; 

Plot[f[x], {x, 0, 4 Pi}, Prolog -> Point[data]]

enter image description here

So your answer is f[x]. You can try to fit it with any trial function. Probably it is possible to get an analytic answer with proper Assumption, but I am not very sure about that. So wait for a better answer.

  • $\begingroup$ Why it is a list and not one number? $\endgroup$ – Mr Bubble Hubble Jun 23 '16 at 13:51
  • $\begingroup$ First one is the time and second is the result $\endgroup$ – Sumit Jun 23 '16 at 13:52
  • $\begingroup$ @Sumit, you forgot the Timing ;) $\endgroup$ – Marius Ladegård Meyer Jun 23 '16 at 13:52
  • $\begingroup$ @Sumit ok, I know that this can be calculated with NIntegrate[]. Can it be calculated symbolically? $\endgroup$ – Mr Bubble Hubble Jun 23 '16 at 13:53
  • $\begingroup$ @Sumit, I need the expr to be integrate over \[Theta] not x $\endgroup$ – Mr Bubble Hubble Jun 23 '16 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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