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.

Suppose $Y = \sqrt{2T}\cos(U)$, $ 0 \le u \le \pi $, and $ 0 \le \cos^{-1}(\frac{y}{\sqrt {2t}}) \le \pi ) $, so $ -1 \le \frac{y}{\sqrt{2t}} \le 1 $, with all $ \mathbb{R}$. The iterated integral is $$ G(y)= P(Y \le y) =P(\sqrt{2T}\cos(U) \le y)=\int_{0}^{y}\int_{0}^{\cos^{-1}(\frac{y}{\sqrt {2t}})} \frac{e^{-t}}{\pi } \mathrm{d}u \mathrm{d}t$$

My Mathematica code is

Integrate[((E^-t)/(\[Pi])), {u, 0,  ArcCos[y/((2 t)^(1/2))]}, 
 Assumptions -> 
  0 <= u <= \[Pi] && -1 <= ArcCos[y/((2 t)^(1/2))] <= 1 && 
   Element[t, Reals] > 0]

Integrate[%, {t, 0, y}, 
 Assumptions -> -1 <= ArcCos[y/((2 t)^(1/2))] <= 1 && 
   Element[t, Reals] > 0]

but then Mathematica never seems to finish evaluating the second one, and so I have to Abort it. Is there any way to find this as a function of $y$? $G(y)$ is a CDF of $Y$.

share|improve this question
1  
Just to make sure, your original expression under the integral is independent of u ? If this is the case, you don't really have to write the whole thing as a double integral. The result of inner integration is obvious - it's just the upper limit. –  Vitaliy Kaurov Sep 6 '12 at 4:43
    
Yes, it is independent of $u$. That's a good point, I will just need to make sure it would be valid for this problem, and should have included that $Y = \sqrt{2T}\cos(U)$, and will do so now. –  Identity Sep 6 '12 at 4:55
    
How can you satisfy $ -1 \le \frac{y}{\sqrt{2t}} \le 1 $ when t is close to zero ? –  b.gatessucks Sep 6 '12 at 5:47
1  
@b.g is right: executing Plot[ArcCos[1/Sqrt[2 t]], {t, 0, 1}] will immediately show that the inverse cosine is not even defined for sufficiently small values of $t$. The difficulty is that this problem--which appears to compute a probability by integration (assuming $T$ and $t$ are the same)--plays fast and loose with inverse trig functions and suffers accordingly. The solution is to re-solve the problem to generate an integral without the inverse cosine. –  whuber Sep 6 '12 at 15:28

1 Answer 1

up vote 2 down vote accepted

Your second integral:

f[y_?NumericQ] := NIntegrate[E^-t ArcCos[y/Sqrt[2 t]]/ Pi, {t, y ^2/2, y}]

Plot[f[x], {x, 0, 2}]

Mathematica graphics

share|improve this answer

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.