0
$\begingroup$

How can I evaluate an integration with another defined integration inside it? The problem is Sin[θ] has different variable and can not be solved directly.

enter image description here

$\endgroup$
4
  • 2
    $\begingroup$ Please post your code as text formatted in a code bock. Also please describe in further detail what you are doing and the circumstance of this problem. $\endgroup$
    – Mr.Wizard
    Jul 31, 2016 at 15:12
  • $\begingroup$ maybe so it be : NIntegrate[Sin[theta]*NIntegrate[Exp[-5/(2*Sin[theta]*Cos[phi])]/( 1 - Exp[-5/(2*Sin[theta]*Cos[phi])]), {phi, 0, Pi}], {theta, 0, Pi}] $\endgroup$ Jul 31, 2016 at 15:51
  • $\begingroup$ @MariuszIwaniuk you ought to go ahead and edit that into the question $\endgroup$
    – george2079
    Jul 31, 2016 at 15:57
  • 1
    $\begingroup$ Do you mean to have the same integration variable in both levels ? $\endgroup$
    – mikado
    Jul 31, 2016 at 17:05

1 Answer 1

2
$\begingroup$

From comment's this User.

f[theta_?NumericQ] := NIntegrate[Exp[-5/(2*Sin[theta]*Cos[phi])]/(1 - Exp[-5/(2*Sin[theta]*Cos[phi])]), {phi, 0, Pi}, 
WorkingPrecision -> 50]

NIntegrate[Sin[theta]*f[theta], {theta, 0, Pi}, WorkingPrecision -> 50]

(* -3.1415926535897932384626433832795028841971693993751 *)

We can identify the number as:

$-\pi$

Edited:

If You want to solve the orginal Question, then:

f[theta_?NumericQ] := NIntegrate[Exp[-5/(2*Sin[theta]*Cos[phi])]/(
1 - Exp[-5/(2*Sin[theta]*Cos[phi])]), {phi, 0, Pi}]

g[theta_?NumericQ] := NIntegrate[Sin[theta]*f[theta], {phi, 0, Pi}]

func = FunctionInterpolation[g[theta], {theta, -1, 1}, 
MaxRecursion -> 20] // Quiet;
Plot[func[theta], {theta, -1, 1}]

enter image description here

I can find the equation of the curve, which is on Plot:

data = Table[{theta, func[theta]}, {theta, -1, 1, 0.1}];
fit = FindFormula[data, theta, 4, All]

enter image description here

A constant -4.9348 I can find by integral:

f[theta_?NumericQ] := NIntegrate[
Exp[-5/(2*Sin[theta]*Cos[phi])]/(1 - Exp[-5/(2*Sin[theta]*Cos[phi])]),   {phi, 0, Pi}, WorkingPrecision -> 50]

 NIntegrate[f[theta], {theta, 0, Pi}, WorkingPrecision -> 50] // Quiet
 (* -4.9348022005446793094172454999380755676568497036204 *)

We can identify the number as:

$-\frac{\pi ^2}{2}$

and Yours integral is:

$-\frac{1}{2} \pi ^2 \sin (\theta )$

$\endgroup$

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