Skip to content

A Surprising Integral

I had a fun encounter with an innocuous looking integral.

It all started with a simple directive:  evaluate \int{cos(\sqrt{x}) \thinspace dx}.

Integration is often tricky business.  Although there is a large body of integration techniques, there isn’t really one guaranteed procedure for evaluating an integral.  If you see what the answer is, you write it down; if you don’t, you try a technique in the hope that it makes you see what the answer is.  If that technique doesn’t work, you try another.

This particular problem is interesting in that it highlights a strange phenomenon that occasionally pops up in problem-solving:  sometimes making a problem look more complicated actually makes it easier to solve.

Let u = \sqrt{x}.  Thus, du = \frac{1}{2\sqrt{x}} dx, and so dx = 2 \sqrt{x} du.  But since u = \sqrt{x}, we have dx = 2 \thinspace u \thinspace du.

This gives us \int{cos(\sqrt{x}) \thinspace dx} = \int{2 \thinspace u \thinspace cos(u) \thinspace du}.

This actually looks a bit more difficult than the original problem, but now we can easily integrate using Integration by Parts!

After applying this technique, we’ll get \int{2 \thinspace u \thinspace cos(u) \thinspace du} = 2 \thinspace u \thinspace sin(u) + 2 \thinspace cos(u) + C.  And so, after un-substituting, we get

\int{cos(\sqrt{x})} = 2\sqrt{x} \thinspace sin(\sqrt{x}) + 2 \thinspace cos(\sqrt{x}) + C.

I was surprised that this technique worked, so I actually differentiated to make sure I got the correct answer.  You can take my word for it, or you can verify with WolframAlpha.

One of the best parts of being a teacher is learning (or re-learning) something new every day!


  1. I like cos(sqrt(x)), because it looks like it should only be defined for positive x, but since cos(x) is even and analytic, you get a power series that works for all values of x. IIRC, the function defined by this series has a surprising graph for negative x.

  2. Timothy Gowers says:

    A technique I like that works here is “successive approximation”. Suppose we start with a naive guess of sin(sqrt(x)), chosen because the sin will at least differentiate to the cos. Then the chain rule gives us an unwanted factor of (2x)^{-1/2}. So to compensate for that we go for (2x)^{1/2}sin(sqrt(x)). But now the product rule gives us an unwanted term of x^{-1/2}sin(sqrt(x)). At this point we can observe that the factor x^{-1/2} is exactly what we need to make the unwanted term easy to integrate.

    • MrHonner says:

      Wow. That’s really cool. It strikes me like integration by parts from another perspective: you are essentially replacing one integral with the sum of a function and another integral, hoping that the new integral is easier to compute, and you find it by playing around with the product rule and chain rule.

      I just tried to use this technique to integrate f'(g(x)) in general, and noticed that the “second” approximation will work when g”(x) / (g'(x))^3 is a constant. This is precisely the situation we have here with g(x) = sqrt(x).

  3. I agree that the best part of teaching is learning.

Leave a Reply