# How to do integral for Cos(x^2)dx?

1. Oct 22, 2006

### jkh4

How to do integral for Cos(x^2)dx? Is there a chain rule for integral? Coz sometimes when I approach questions like that i just don't know how to approach....thanks!

2. Oct 22, 2006

you have to look it up in a table of integrals:

$$\int_{0}^{\infty} \cos (x^{2}) dx = \int_{0}^{\infty} \sin (x^{2}) dx = \frac{1}{2}\sqrt{\frac{\pi}{2}}$$

If you mean $$\int \cos^{2} x$$ then you would change it to $$\int \frac{1+\cos 2x}{2}$$

Last edited: Oct 22, 2006
3. Oct 22, 2006

### HallsofIvy

And if you mean the general anti-derivative of cos(x2), it is not an "elementary" function. That is, it cannot be written in terms of functions you normally learn (polynomials, rational functions, radicals, exponentials, logarithms, trig functions.

4. Oct 22, 2006

### murshid_islam

or you can expand $$\cos (x^{2})$$ into a series and then integrate each term (and thus get an approximation).

by the way, how can you prove this:
$$\int_{0}^{\infty} \cos (x^{2}) dx = \int_{0}^{\infty} \sin (x^{2}) dx = \frac{1}{2}\sqrt{\frac{\pi}{2}}$$

5. Feb 2, 2008

### agomez

Simple Solution

To prove:
$$\int_{0}^{\infty} \cos (x^{2}) dx = \int_{0}^{\infty} \sin (x^{2}) dx = \frac{1}{2}\sqrt{\frac{\pi}{2}}$$

Given:
$$e^{i \theta} = \cos (\theta) + i \sin (\theta)$$ & the Gaussian Integral: $$\int_{-\infty}^{\infty} e^{-\alpha x^2} dx = \sqrt{\frac{\pi}{\alpha}}$$

Consider:
$$\int_{-\infty}^{\infty} e^{-i x^{2}} dx = \int_{-\infty}^{\infty}\cos (x^{2}) - i \sin (x^{2}) dx = \sqrt{\frac{\pi}{i}}$$

Now $$\sqrt{-i} = \sqrt{e^{-i \frac{\pi}{2}}} = e^{-i \frac{\pi}{4}}$$ in the principal branch $$(-\pi < \theta \leq \pi)$$

Therefore:
$$\int_{0}^{\infty}\cos (x^{2}) dx - i \int_{0}^{\infty} \sin (x^{2}) dx = \frac{1}{2}\sqrt{\frac{\pi}{2}} - i\frac{1}{2}\sqrt{\frac{\pi}{2}}$$ since the integrands are even functions.

QED

6. Jul 23, 2010

### LuisVela

Hello there =)
I got it, its a brilliant way of proving it. But i think im missing something ....

isnt it true that:
$$e^{-i\frac{\pi}{4}}=\cos{\frac{\pi}{4}}-i\sin{\frac{\pi}{4}}$$ ?

and

$$\cos{\frac{\pi}{4}}=\sin{\frac{\pi}{4}}=\frac{\sqrt{2}}{2}$$

which ,I dont know how, got to be (according to you) :

$$\frac{1}{2\sqrt{2}}$$

...im really stuck here...can you help me?

like I said...im missing smth here...

7. Jul 23, 2010

### LuisVela

...limits of integration....got it!!!

8. Jul 23, 2010

### Anthony

Re: Simple Solution

But the major task here is to show that your result holds for $$\alpha$$ imaginary. This requires complex analysis.

9. Jul 23, 2010

### Mute

Re: Simple Solution

It's not that major a task. It's pretty easy once you have the right contour. ;) For those interested,

$$\oint_C dz e^{iz^2}$$

where C is the contour with components C1 = the real axis from 0 to R, C2 = an arc of radius R subtending an angle of $\pi/4$, and C3 = a straight line from the end of C2 to the origin.

Since this contour encloses no poles, the contour integral is zero. Hence, parametrizing $z = x$ on C1, $z = Re^{i\theta}$ on C2 and $z = xe^{i\pi/4}$ on C3,

$$0 = \int_0^R dx e^{ix^2} + iR\int_0^{\pi/4}d\theta e^{i\theta} e^{iR^2e^{i2\theta}} + \int_R^0 dx e^{i\pi/4} e^{ix^2e^{i\pi/2}},$$
which gives

$$\int_0^R dx e^{-x^2} e^{i\pi/4} = \int_0^R dx e^{ix^2} + iR\int_0^{\pi/4}d\theta e^{i\theta} e^{iR^2\cos(2\theta)}e^{-R^2\sin(2\theta)}$$

Now we take the limit as $R \rightarrow \infty$. The integral on C2 satisfies the inequality

$$\left|iR\int_0^{\pi/4}d\theta e^{i\theta} e^{iR^2\cos(2\theta)}e^{-R^2\sin(2\theta)}\right| \leq R\int_0^{\pi/4}d\theta e^{-R^2\sin(2\theta)}$$

Because $\sin(2\theta) > 0$ when $0 < 2\theta < \pi/4$, the RHS of the inequality tends to zero as R grows large and hence doesn't contribute to the integral. We thus have

$$\int_0^\infty dx e^{-x^2} e^{i\pi/4} = \int_0^\infty dx e^{ix^2}$$.

Recognizing the Gaussian integral on the LHS and taking the complex conjugate to get the desired integral gives

$$\int_0^\infty dx e^{-ix^2} = \frac{\sqrt{\pi}}{2}e^{-i\pi/4} = \frac{1}{2}\sqrt{\frac{\pi}{i}}$$
as required for the above proof of the integral of cos(x^2) or sin(x^2).

10. Jul 23, 2010

### Anthony

Re: Simple Solution

Not easy enough, it would seem!

You need Jordan's lemma type argument - your current version doesn't hold water, I'm afraid.

11. Jul 23, 2010

### jackmell

\begin{aligned} R\int_{0}^{\pi/4} e^{-R^2\sin(2t)}dt&<R\int_{0}^{\pi/4} e^{-R^2 4x/\pi}dx \\ &<-\frac{R\pi}{4R^2}e^{-R^2 4x/\pi}\biggr|_0^{\pi/4} \\ &<-\frac{\pi}{4R}\left(e^{-R^2}-1\right) \end{aligned}

Just draw a line segment from the origin to the point (pi/4,1) to get the line y=4x/pi and that is less than sin(2t) which is above it in the integration interval. That last expression then goes to zero as R goes to infinity.

12. Jul 23, 2010

### Mute

Re: Simple Solution

If you insist on more rigor, it is easily supplied: on the integration contour the inequality

$$\sin(2\theta) \geq \frac{4\theta}{\pi}$$
holds. (Due to concavity of the sine function on this interval).

Hence,
$$R\int_0^{\pi/4}d\theta e^{-R^2\sin(2\theta)} \leq R\int_0^{\pi/4}d\theta e^{-4R^2\theta/\pi} = -\frac{4}{\pi R}\left(e^{-R^2} - 1\right)$$
which tends to zero as R tends to infinity.

Still pretty easy. ;) (Edit: And beaten to it, too!)

Of course, I can keep adding rigor and other steps I skipped:

$$\sin(2\theta) \geq \frac{4\theta}{\pi}$$
so, because $e^x$ is a monotonically increasing function, it follows that $\exp(\sin(2\theta)) \geq \exp(\frac{4\theta}{\pi})$; taking the reciprocal reverses the inequality, so we have $\exp(-\sin(2\theta)) \leq \exp(-\frac{4\theta}{\pi})$. By a theorem of calculus, if $f(x) \leq g(x)$ on some interval, then
$$\int dx f(x) \leq \int dx g(x)$$
as long as the limits of integral are a subset of the interval on which the inequality holds. Thus,
$$R\int_0^{\pi/4}d\theta e^{-R^2\sin(2\theta)} \leq R\int_0^{\pi/4}d\theta e^{-4R^2\theta/\pi} = -\frac{4}{\pi R}\left(e^{-R^2} - 1\right).$$

Boy, that's a long proof! Maybe it isn't easy after all! No wonder mathematicians take forever to get anything done, always insisting on so much rigor! ;)

Last edited: Jul 23, 2010
13. Jul 23, 2010

### snipez90

Don't know what Jordan's lemma is (will find out soon enough), but I'm pretty sure you can just integrate by parts to get the estimate for
$$R\int_0^{\pi/4}d\theta e^{-R^2\sin(2\theta)}.$$

Also you do not need complex analysis to evaluate the Fresnel integrals. You can use somewhat contrived arguments to compute the integrals via multivariable calculus. Since I'm more fond of real analysis at this point, I prefer real-analytic solutions.

14. Jul 24, 2010

### Anthony

Excellent, well done!
You might not need complex analysis to evaluate integrals of this form, but it's the standard treatment. I'm sure there's actually a book containing lots of integrals that are usually done via complex analysis, but explicitly calculates them using real analysis. I don't really see the point (why rub sticks together if you have a lighter), but some are fond of such things.

How would your integration by parts estimate work?

15. Jul 24, 2010

### Mute

An interesting note about multivariate calculus methods vs. complex calculus methods, to go on a slight tangent here, is that the Gaussian integral is evaluated by multivariate calculus instead of complex calculus because it's actually very hard to find a contour and integrand that you can actually use to evaluate the integral. I saw a contour integral for it once, and it was a somewhat contrived looking integrand. After some searching I found it (incidentally my Google search led to another thread on the forums which linked to the page with the document):

$$\oint dz \frac{e^{i\pi z^2}}{\sin(\pi z)}$$

Integrating around a parallelogram with vertices $\pm \pi/2 \pm Re^{i\pi/4}$ and taking R to infinity gives the result.

(A note on the document linked to: it contains many derivations of the Gaussian integral, but they are not 'rigorous' derivations that would satisfy our mathematician friends in the audience - for instance, the standard double integral method is performed, but no care is taken in treating the limits of integration properly: they simply switch from $\{x,y\} \in (-\infty,\infty)U(-\infty,\infty)$ to $\{r,\theta\} \in [0,\infty)U[0,2\pi)$, which as far as a real analyst is concerned is too presumptuous, I believe ;) )

Last edited: Jul 24, 2010
16. Oct 20, 2010

### baranij

Hello,
Would it also hold true if the limits of integration are other than 0 to infinity that
$$\int_{ }^{ } \cos (x^{2}) dx = \int_{ }^{} \sin (x^{2}) dx$$ ?

What about if $$x^{a}$$ (x is raised to an arbitrary power like?
$$\int_{ }^{ } \cos (x^{3}) dx$$

Thank you for the help.

17. Jan 23, 2011

### Beamsbox

I ran into the same cos (x^2) in a problem... though not as complex. how do you solve this for zero? I need to find where the graph crosses the x-axis.

Cos (x^2) = 0...?

18. Jan 23, 2011

### Beamsbox

Crap, nevermind... been a while... ;)

19. Dec 9, 2012

### sentinel

can it be done without countor integration?