# Calculate a definite integral involving sin and exp

I got these definite integrals from the moments.

I am required to calculate the definite integrals $$\int_{0}^{\infty}x^kf(x)dx$$, where $$f(x)=e^{-x^{\frac{1}{4}}}sin(x^{\frac{1}{4}})$$ and $$k\in\mathbb N$$.

I have been through a tough time on trying to calculate it. I tried to change variable and integrate by parts, but it seems not working.

Any help will be appreciated.

Edit:

I first used the change of variable turing the definite integral into $$4\int_0^{\infty}y^{4k+3}e^{-y}sin(y)dy$$, where $$y=x^{\frac{1}{4}}.$$

And then when I tried to integrate by parts, two new terms will come out, which are $$y^{4k+2}sin(y)$$ and $$y^{4k+3}cos(y).$$ I noticed that we can never eliminate the power of $$y$$ from the second term, so I had no idea how to go on.

• ops the range should be $[0,\infty]$ – Sam Wong Mar 12 at 6:45
• A better choice for integration by parts is $u = y^{4 k + 3}$, $dv = e^{-y} \sin y \,dy$, but even this becomes a little messy, owing to the fact that $k$ is arbitrary. It simplifies things some to write $\sin y$ in terms of complex numbers, so that problem amounts to integrating $y^{4 k + 3} e^{a y}$ for some constant $a$. Then, the integrating step in integration by parts becomes a little more tractable. See my answer. – Travis Mar 12 at 7:17

## 2 Answers

Hint The appearance of the quantity $$\require{cancel}x^{1 / 4}$$ inside the arguments of $$\exp$$ and $$\sin$$ suggest the substitution $$x = u^4, \qquad dx = 4 u^3 du,$$ which transforms the integral into $$4 \int_0^\infty u^{4 k + 3} e^{-u} \sin u \,du = 4 \int_0^\infty u^{4 k + 3} e^{-u} \operatorname{Im}(e^{i u}) \,du = 4 \operatorname{Im} \int_0^{\infty} u^{4 u + 3} e^{(-1 + i) u} du .$$ The form of the integrand suggests applying integration by parts. Doing so for $$\int_0^{\infty} u^m e^{(-1 + i) u} du$$ with $$p = u^m$$, $$dq = e^{(-1 + i) u} du$$ gives $$\cancelto{0}{\left.u^m \cdot \frac{1}{-1 + i} e^{(-1 + i) u} \right\vert_0^\infty} - \int_0^\infty m u^{m - 1} \frac{1}{-1 + i} e^{(-1 + i) u} du .$$ So, if we denote $$I_m := \int_0^{\infty} u^m e^{(-1 + i) u} du ,$$ the integrals $$I_m$$ satisfy the reduction formula $$I_m = -\frac{m e^{-3 \pi i / 4}}{\sqrt{2}} I_{m - 1}.$$

• Thanks! But how did you come up an idea that turns sin $u$ into Im($e^{iu}$)? This step is so amazing. – Sam Wong Mar 12 at 7:19
• You're welcome. This is a standard trick for integrals that involve both $\exp$ and $\sin$ or $\cos$---even when $\exp$ doesn't appear in the integrand, rewriting $\sin$ or $\cos$ in terms of the complex exponential sometimes simplifies things. – Travis Mar 12 at 7:21
• @SamWong FYI, I recall listening to a talk from some of the developers involved with writing the Maple symbolic & numeric computing environment fairly shortly after it was initially created (this would have been about $1985$). They described some of what it did behind the scenes, including tricks like what Travis used to convert parts of certain integrals to the real or imaginary part of a complex function which is easier to integrate. After all these years, Maple has likely changed quite a bit in terms of how it works internally, but I suspect certain "tricks" like this are still being used. – John Omielan Mar 12 at 7:34

An alternative approach. Here your integral is: $$\begin{equation} I = 4\int_0^\infty x^{4k + 3} e^{-x} \sin(x)\:dx\nonumber \end{equation}$$ Here we will employ Feynman's Trick by introducing the function $$\begin{equation} J(t) = 4\int_0^\infty x^{4k + 3} e^{-tx} \sin(x)\:dx\nonumber \end{equation}$$ We observe that $$J(1) = I$$. Now: $$\begin{equation} \frac{\partial}{\partial t} e^{-tx} = -x e^{-tx} \Longrightarrow \frac{\partial^{4k + 3}}{\partial t^{4k + 3}} e^{-tx} = \left(-1\right)^{4k + 3} x^{4k + 3}e^{-tx} = -x^{4k + 3}e^{-tx} \end{equation}$$ And thus, $$\begin{equation} J(t) = 4\int_0^\infty x^{4k + 3} e^{-tx} \sin(x)\:dx = 4\int_0^\infty -\frac{\partial^{4k + 3}}{\partial t^{4k + 3}} e^{-tx} \sin(x)\:dx = -4\int_0^\infty \frac{\partial^{4k + 3}}{\partial t^{4k + 3}} e^{-tx} \sin(x)\:dx\nonumber \end{equation}$$ By Leibniz's Integral Rule: $$\begin{equation} J(t) =-4\int_0^\infty \frac{\partial^{4k + 3}}{\partial t^{4k + 3}} e^{-tx} \sin(x)\:dx = -4\frac{\partial^{4k + 3}}{\partial t^{4k + 3}} \int_0^\infty e^{-tx}\sin(x)\:dx \nonumber \end{equation}$$ Now $$\begin{equation} \int e^{ax}\sin\left(bx\right)\:dx = \frac{e^{ax}}{a^2 + b^2}\left(a\sin(bx) - b\cos(bx) \right) + C\nonumber \end{equation}$$ Thus our integral becomes \begin{align} J(t) &=-4 \frac{\partial^{4k + 3}}{\partial t^{4k + 3}} \int_0^\infty e^{-tx}\sin(x)\:dx = -4\frac{\partial^{4k + 3}}{\partial t^{4k + 3}} \left[\frac{e^{-tx}}{t^2 + 1}\left(-t\sin(x) - \cos(x) \right) \right]_0^{\infty}\nonumber \\ &= -4 \frac{\partial^{4k + 3}}{\partial t^{4k + 3}} \left[\frac{1}{t^2 + 1} \right] \nonumber \end{align} And so we can express the solution to $$I$$ as $$\begin{equation} I = J(1) = -4\frac{\partial^{4k + 3}}{\partial t^{4k + 3}} \frac{1}{t^2 + 1}\bigg|_{t = 1} \end{equation}$$

• Just now realised that this could possibly be addressed better with Mellin Transformations and Ramunajan's Master Theorem. If you would like me to add that to this solution, please advise and I will type up tomorrow. – user619699 Mar 17 at 14:42