# Code to solve integral including Bessel function numerically in Matlab [Solved]

$\int\limits_{0}^{\infty}dx\sqrt{x}J_{\frac{4}{3}}(x)\sin{ax} \quad a>1$

How can I write a code in Matlab that solve this integral numerically?. I'm new to Matlab. Usually, I use Mathematica. However, the Mathematica could not solve this integral.

• What Mathematica command did you use? – Moo Jul 3 '17 at 22:22
• What do you mean solve this equation? There is no equation stated – Batman Jul 3 '17 at 22:23
• @Batman Sorry. I meant the integral. – Dinesh Shankar Jul 3 '17 at 22:36

## 2 Answers

Really strange, since the integrand can be greatly simplified. We have $$J_{\frac{3}{2}}(x) = \frac{\sin(x)-x\cos(x)}{x^{3/2}}\sqrt{\frac{2}{\pi}}\tag{1}$$ hence the regularized value of the wanted integral equals $$\sqrt{\frac{2}{\pi}}\,\text{RV}\int_{0}^{+\infty}\frac{\sin(x)-x\cos(x)}{x}\cos(\alpha x)\,dx=\sqrt{\frac{2}{\pi}}\int_{0}^{+\infty}\frac{\sin(x)\cos(\alpha x)}{x}\,dx \tag{2}$$ i.e. $\sqrt{\frac{\pi}{2}},\frac{1}{2}\sqrt{\frac{\pi}{2}}$ or $0$ according to $|\alpha|<1, |\alpha|=1$ or $|\alpha|>1$.
We need to consider a regularization since $\sqrt{x}\,J_{3/2}(x)\cos(\alpha x)$ is not improperly Riemann-integrable over $\mathbb{R}^+$, strictly speaking: $J_{3/2}(x)$ does not decay fast enough to zero to compensate the $\sqrt{x}$ term, but $\cos(\alpha x)$ has a bounded primitive. The regularization previously considered is the exponential/Laplace regularization: $$\text{RV}\int_{0}^{+\infty}f(x)\,dx = \lim_{\lambda\to 0^+}\int_{0}^{+\infty}f(x) e^{-\lambda x}\,dx.$$

• @user3321: I have just defined what I mean by $\text{RV}$. – Jack D'Aurizio Jul 3 '17 at 22:56

I don't think this can be integrated. However, here is a sample code that shows how I approached your problem:

## $$\begin{matrix} a=pi; nu=4/3;\\ x=linspace(0,100,100001)';\\ dx=x(2);\\ integrand=sqrt(x).*besselj(nu,x).*sin(a*x);\\ figure;plot(x,integrand)\\ ans=cumtrapz(integrand)*dx;\\ figure;plot(x,ans) \end{matrix}$$

(Apologies for the strange text; I don't know how to enter formatted text here.)

So, you can see both the integrand and the cumulative integral are oscillating wildly. Are you sure that you have specified the problem correctly? I also ran the integral in Mathematica with both Integrate and NIntegrate to no avail.