Problem
I have a problem with the following integral \begin{equation*} I_2(t)\triangleq \int_0^t \tau\,\cos(c+b\tau+a\tau^2)\text{ d}\tau \end{equation*} where $t,a,b,c$ are given parameters. For simplicity, assume that $a\geq 0$ (the case $a<0$ introduce pointless difficulties about the right choice of some signs of the trigonometric function involved).
I've got a potential solution, which it seems correct and it is derived in what follows, and has the following form \begin{equation*} I_2(t)=I_{\parallel}(t)\cos(q_3)-I_{\perp}(t)\sin(q_3) \end{equation*} where:
- $I_{\parallel}(t)\triangleq \phantom{-}\frac{\sin(h_t^2)-\sin(h_0^2)}{2q_1}+\frac{q_2 (C(h_t)-C(h_0))}{\sqrt{q_1}}$;
- $I_{\perp}(t)\triangleq -\frac{\cos(h_t^2)-\sin(h_0^2)}{2q_1}+\frac{q_2 (S(h_t)-S(h_0))}{\sqrt{q_1}}$;
- $C(h)\triangleq \int_0^h \cos(\alpha^2)\text{ d}\alpha$, $S(h)\triangleq \int_0^h \sin(\alpha^2)\text{ d}\alpha$ -- known as Fresnel integrals;
- $h_t\triangleq \sqrt{q_1}(t-q_2)$, $h_0\triangleq-\sqrt{q_1}q_2$;
- $q_1\triangleq a$, $q_2\triangleq -\frac{b}{2a}$, $q_3\triangleq c-\frac{b^2}{4a}$
Now, I want to do a sanity check about the solution above. Consider the simpler integral \begin{equation*} I_1(t)\triangleq \int_0^t \tau\,\cos(c+b\tau)\text{ d}\tau \end{equation*} whose solution, if I'm not wrong, is \begin{equation*} I_2(t)=\frac{\cos(\theta_t)-\cos(\theta_0)}{b^2}+\frac{\theta_t\sin(\theta_t)-\theta_0\sin(\theta_0)}{b^2}-\frac{c(\sin(\theta_t)-\sin(\theta_0))}{b^2} \end{equation*} where $\theta_t\triangleq bt+c$ and $\theta_0\triangleq c$. A necessary condition to validate $I_2(t)$ (conditioned to the fact that $I_1(t)$ is correct), is \begin{equation*}\lim_{a\to 0} I_2(t)=I_1(t)\end{equation*} so my problem is the following: prove the following limit \begin{equation*} \lim_{a\to 0}\bigg[I_{\parallel}(t)\cos(q_3)-I_{\perp}(t)\sin(q_3)\bigg]=\frac{\cos(\theta_t)-\cos(\theta_0)}{b^2}+\frac{\theta_t\sin(\theta_t)-\theta_0\sin(\theta_0)}{b^2}-\frac{c(\sin(\theta_t)-\sin(\theta_0))}{b^2} \end{equation*} But before digging in the math and loose time in vain, I want to make a quick numeric check about the previous limit. If the numeric results are not coherent, then is stupid strive to proof the previous limit (which in that case is surely false).
References
So far, I've been heavily helped from the community in my studies and most of the ideas are not mine (love you all guys!). Little step by little step, thanks to the forum I'm learning a lot of new stuff about the trigonometric integrals. If you are interested, you can retrieve some useful information related to the actual problem from these previous posts:
- Computing $\int_0^t \tau\,\cos(c+b\tau+a\tau^2)\text{ d}\tau$
- Quadratic-trigonometric integral -- part 3
Outline
In order to clarify my questions, in what follows I will present:
- my derivation of $I_2(t)$;
- my derivation of $I_1(t)$;
- some numerical results about the computation of the limit $\lim_{a\to 0} I_2(t)$;
- my questions.
Derivation of $I_2(t)$
The first step consists into completing the square inside the cosine, i.e. writing the argument as \begin{equation*} c+b\tau+a\tau^2=q_1(\tau-q_2)^2+q_3 \end{equation*} with \begin{equation*} q_1\triangleq a \qquad q_2\triangleq -\frac{b}{2a} \qquad q_3\triangleq c-\frac{b^2}{4a} \end{equation*} this trick, also thanks to the usual trigonometric identities, allows to write the integral in the following form \begin{equation*} I_2(t)=\underbrace{\left[\int_0^t \tau\,\cos[q_1(\tau-q_2)^2]\text{d}\tau\right]}_{\triangleq I_{\parallel}(t)}\cos(q_3)-\underbrace{\left[\int_0^t \tau\,\sin[q_1(\tau-q_2)^2]\text{d}\tau\right]}_{\triangleq I_{\perp}(t)}\sin(q_3) \end{equation*} so now the problem is to compute $I_{\parallel}(t)$ and $I_{\perp}(t)$. Focus on $I_{\parallel}(t)$, start by writing \begin{equation*} I_{\parallel}(t)=\int_0^t (\tau-q_2)\,\cos[q_1(\tau-q_2)^2]\text{ d}\tau+q_2\int_0^t \cos[q_1(\tau-q_2)^2]\text{ d}\tau \end{equation*} and then consider the change of variable \begin{equation*}h(\tau)\triangleq \sqrt{q_1}(\tau-q_2).\end{equation*} Consequently, if $h_t\triangleq h(t)=\sqrt{q_1}(t-q_2)$ and $h_0\triangleq h(0)=-\sqrt{q_1}q_2$, the integral gets the form \begin{equation*}\begin{aligned} I_{\parallel}(t)&=\int_{h_0}^{h_t} \frac{h}{\sqrt{q_1}}\,\cos(h^2)\frac{\text{ d}h}{\sqrt{q_1}}+q_2\int_{h_0}^{h_t} \cos(h^2)\frac{\text{d}h}{\sqrt{q_1}}\\ &=\frac{1}{q_1}\int_{h_0}^{h_t} h\cos(h^2)\text{ d}h+\frac{q_2}{\sqrt{q_1}}\int_{h_0}^{h_t} \cos(h^2)\text{d}h\\ &=\frac{1}{q_1}\frac{\sin(h^2)}{2}\bigg|_{h_0}^{h_t}+\frac{q_2}{\sqrt{q_1}}\left[ \int_0^{h_t}\cos(h^2)\text{ d}h-\int_0^{h_0}\cos(h^2)\text{ d}h \right]\\ &=\frac{\sin(h_t^2)-\sin(h_0^2)}{2q_1}+\frac{q_2(C(h_t)-C(h_0))}{\sqrt{q_1}} \end{aligned} \end{equation*} where is introduced the Fresnel cosine integral \begin{equation*}C(h)\triangleq \int_0^h \cos(\alpha^2)\text{ d}\alpha.\end{equation*} The same procedure, with some minor adjustments, can be used to compute $I_{\perp}(t)$, and the result is \begin{equation*} I_{\perp}(t)=-\frac{\cos(h_t^2)-\cos(h_0)}{2q_1}+\frac{q_2(S(h_t)-S(h_0))}{\sqrt{q_1}} \end{equation*} where is introduced the Fresnel sine integral \begin{equation*}S(h)\triangleq \int_0^h \sin(\alpha^2)\text{ d}\alpha.\end{equation*}
Derivation of $I_1(t)$
With the same spirit of the previous derivation, write $I_1(t)$ in the following equivalent form \begin{equation*} I_1(t)=\frac{1}{b}\left[\int_0^t (c+b\tau)\,\cos(c+b\tau)\text{ d}\tau-c\int_0^t \cos(c+b\tau)\text{ d}\tau\right] \end{equation*} and consider the following change of variable \begin{equation*}\theta(\tau)\triangleq c+b\tau\end{equation*} so that, if $\theta_t\triangleq \theta(t)=c+bt$ and $\theta_0\triangleq \theta(0)=c$, holds \begin{equation*}\begin{aligned} I_1(t)&=\frac{1}{b}\left[\int_{\theta_0}^{\theta_t} \theta\,\cos(\theta)\frac{\text{ d}\theta}{b}-c\int_{\theta_0}^{\theta_t} \cos(\theta)\frac{\text{ d}\theta}{b}\right]\\ &=\frac{1}{b^2}\bigg[\cos(\theta)+\theta\sin(\theta)\bigg]_{\theta_0}^{\theta_t}-\frac{c}{b^2}\sin(\theta)\bigg|_{\theta_0}^{\theta_t}\\ &=\frac{\cos(\theta_t)-\cos(\theta_0)}{b^2}+\frac{\theta_t\sin(\theta_t)-\theta_0\sin(\theta_0)}{b^2}-\frac{c(\sin(\theta_t)-\sin(\theta_0))}{b^2} \end{aligned} \end{equation*}
Numerical results
The (very nice - and not mine) idea is to check numerically the limit above by computing the ratio $I_2(t)/I_1(t)$ for a sequence $\{a_k\}_{k=1}^K$ of different values for $a$ which is decreasing to zero, for example $a_k=10^{-k}$. The other parameters $t,c,b$ are instead keep fixed during the actual experiment.
experiment 1: $t\triangleq 1$, $c\triangleq \pi/4$, $b\triangleq \pi/100$ \begin{equation*} \begin{array}{l|llllllllll} k & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\\ \frac{I_1}{I_2} & 1.0570 & 1.0053 & 1.0005 & 1.0001 & 1.0000 & 1.0000 & 1.0000 & 0.9997 & 0.9896 & -0.6661 \end{array} \end{equation*}
experiment 2: $t\triangleq 1$, $c\triangleq \pi/4$, $b\triangleq \pi/6$ \begin{equation*} \begin{array}{l|llllllllll} k & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\\ \frac{I_1}{I_2} & 1.1263 & 1.0112 & 1.0011 & 1.0001 & 1.0000 & 1.0000 & 1.0013 & 0.9106 & -0.2159 & 0.0008 \end{array} \end{equation*}
experiment 3: $t\triangleq 10$, $c\triangleq \pi/4$, $b\triangleq \pi/100$ \begin{equation*} \begin{array}{l|llllllllll} k & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\\ \frac{I_1}{I_2} & -3.2269 & 7.7321 & 1.0876 & 1.0080 & 1.0008 & 1.0001 & 1.0000 & 1.0000 & 0.9998 & 1.0203 \end{array} \end{equation*}
experiment 4: $t\triangleq 10$, $c\triangleq \pi/4$, $b\triangleq \pi/6$ \begin{equation*} \begin{array}{l|llllllllll} k & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10\\ \frac{I_1}{I_2} & 1.2993 & -0.5334 & 1.6713 & 1.0429 & 1.0041 & 1.0004 & 0.9997 & 0.9840 & 0.5977 & 0.0188 \end{array} \end{equation*}
The results are quite encouraging, and I think that I can consider plausible the analytic expression for $I_2(t)$. However there is an evident loss of numeric accuracy around $10^{-8}$.
Edit
I think it is worth to point out that, from the numerical results above, it seems that $I_2(t)$ diverges to infinity as $a\to0$.
Questions
1) Basing on the previous numerical results, can I consider correct the analytic expressions for $I_1(t)$, $I_2(t)$ and so move on the analytic proof of the limit?
2) Is it normal to loose so much accuracy around $10^{-8}$? I'm working in single precision in MATLAB and I'm using fresnelc,fresnels to compute the Fresnel integrals.
Note that fresnelc,fresnels are defined as the normalized Fresnel integrals
\begin{equation*}
NC(h)\triangleq \int_0^h \cos\left(\frac{\pi}{2}\alpha^2\right)\text{ d}\alpha \qquad
NS(h)\triangleq \int_0^h \sin\left(\frac{\pi}{2}\alpha^2\right)\text{ d}\alpha
\end{equation*}
the unnormalizing laws are
\begin{equation*}
C(h)= \sqrt{\frac{\pi}{2}}NC\left(\frac{2}{\pi}h\right) \qquad
S(h)= \sqrt{\frac{\pi}{2}}NS\left(\frac{2}{\pi}h\right)
\end{equation*}
3) From the analytical point of view, is it true that $I_2(t)$ diverge to infinity? This fact would prove that the expression of $I_2(t)$ above is wrong.