0
$\begingroup$

Im trying to integrate the following:

\begin{equation} \int_{-1}^{1}\int_{-1}^{1}\int_{-1}^{x} J_{3/4}(x^2 z)J_{1/4}(y^2z) dy dz dx \end{equation}

So what I did was this

i1[x_?NumericQ, z_?NumericQ] := 
 i1[x, z] = NIntegrate[BesselJ[1/4, y^2 z], {y, -1, x}]
i2[x_?NumericQ] := 
 i2[x] = NIntegrate[BesselJ[3/4, x^2 z] i1[x, z], {z, -1, 1}]
NIntegrate[i2[x], {x, -1, 1}]

Is this correct? And if so, is there any other way to make this faster?

Thanks in advance.

$\endgroup$
  • $\begingroup$ Have you tried it as a multiple integral? How precise do you want the answer? $\endgroup$ – Michael E2 Sep 8 '16 at 11:39
  • $\begingroup$ I haven't tried it. However, my post is just something that looks similar to my original problem and my original problem is something that needs numerical integration. I just want a result that does not show this: Numerical integration converging too slowly; suspect one of the \ following: singularity, value of the integration is 0, highly \ oscillatory integrand, or WorkingPrecision too small. $\endgroup$ – PhilCsar Sep 8 '16 at 11:42
1
$\begingroup$

I believe the integral is 0 exactly, by symmetry (z -> -z):

FullSimplify[
 BesselJ[3/4, x^2 z] BesselJ[1/4, y^2 z] + 
   BesselJ[3/4, x^2 (-z)] BesselJ[1/4, y^2 (-z)],
 {x, y, z} ∈ Reals]
(*  0  *)

Numerical test: Set it up so that the "EvenOddSubdivision" strategy may be applied to the z-integral:

NIntegrate[BesselJ[3/4, x^2 z] BesselJ[1/4, y^2 z],
 {x, -1, 1}, {y, -1, x}, {z, -1, 1}, 
 Method -> {"EvenOddSubdivision", 
   Method -> {"LobattoKronrodRule", "GaussPoints" -> 5}}, 
 MaxRecursion -> 0, AccuracyGoal -> 16]
(*  1.9636*10^-18  *)

(You need to set a finite AccuracyGoal to avoid a convergence warning.)

$\endgroup$
  • $\begingroup$ Thanks. But is the code right? $\endgroup$ – PhilCsar Sep 8 '16 at 11:59
  • $\begingroup$ @PhilCsar Do you mean did Mathematica make a mistake? Or are you suggesting I messed up the cut & paste of the integrand? -- The interval -1 <= z <= 1 is symmetric with respect to the reflection z -> -z, so the integral over {z, -1, 0} cancels the integral over {z, 0, 1}....if there's no error in my copying. It agrees with numerical tests, up to the error in numerical integration which is somewhat large (<0.001). $\endgroup$ – Michael E2 Sep 8 '16 at 12:04
  • $\begingroup$ Im just asking if my code is correct because Im not sure if I used NumericQ correctly :D $\endgroup$ – PhilCsar Sep 8 '16 at 12:07
  • $\begingroup$ @PhilCsar It seems right, but it will be slow. $\endgroup$ – Michael E2 Sep 8 '16 at 12:09
  • $\begingroup$ @PhilCsar If an integral is zero, NIntegrate will always give a convergence warning unless you set a finite AccuracyGoal to however many digits you want verified are zero. $\endgroup$ – Michael E2 Sep 8 '16 at 12:20

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.