Explorations in math and programming
David Lowry-Duda

Research kicks up, writing kicks back. So in this brief note, we examine a pair of methods to examine an integral. They're both very clever, I think. We seek to understand $$ I := \int_0^{\pi/2}\frac{\sin(x)}{\sin(x) + \cos(x)} dx $$

We base our first idea on an innocuous-seeming integral identity.

For ${f(x)}$ integrable on ${[0,a]}$, we have $$ \int_0^a f(x) dx = \int_0^a f(a-x)dx. \tag{1}$$

The proof is extremely straightforward. Perform the substitution ${x \mapsto a-x}$. The negative sign from the ${dx}$ cancels with the negative coming from flipping the bounds of integration. ${\diamondsuit}$

Any time we have some sort of relationship that reflects into itself, we have an opportunity to exploit symmetry. Our integral today is very symmetric. As ${\sin(\tfrac{\pi}{2} - x) = \cos x}$ and ${\cos(\tfrac{\pi}{2} - x) = \sin x}$, notice that $$ I = \int_0^{\pi/2}\frac{\sin x}{\sin x + \cos x}dx = \int_0^{\pi/2}\frac{\cos x}{\sin x + \cos x }dx. $$ Adding these two together, we see that $$ 2I = \int_0^{\pi/2}\frac{\sin x + \cos x}{\sin x + \cos x} dx = \frac{\pi}{2}, $$ and so we conclude that $$ I = \frac{\pi}{4}. $$ Wasn't that nice? ${\spadesuit}$

Let's show another clever argument. Now we rely on a classic across all mathematics: add and subtract the same thing. \begin{align} I = \int_0^{\pi/2}\frac{\sin x}{\sin x + \cos x}dx &= \frac{1}{2} \int_0^{\pi/2} \frac{2\sin x + \cos x - \cos x}{\sin x + \cos x}dx \\ &= \frac{1}{2} \int_0^{\pi/2} \frac{\sin x + \cos x}{\sin x + \cos x}dx + \frac{1}{2}\int_0^{\pi/2}\frac{\sin x - \cos x}{\sin x + \cos x}dx. \end{align} The first term is easy, and evaluates to ${\tfrac{\pi}{4}}$. How do we handle the second term? In fact, we can explicitly write down its antiderivative. Notice that ${\sin x - \cos x = -\frac{d}{dx} (\sin x + \cos x)}$, and so the last term is of the form $$ -\frac{1}{2}\int_0^{\pi/2} \frac{f'(x)}{f(x)}dx $$ where ${f(x) = \sin x + \cos x}$. You may or may not remember that ${\frac{f'(x)}{f(x)}}$ is the logarithmic derivative of ${f(x)}$, or rather what you get if you differentiate ${\log f(x)}$. As we are integrating the derivative of ${\log f(x)}$, we see that $$ -\frac{1}{2} \int_0^{\pi/2}\frac{f'(x)}{f(x)}dx = -\frac{1}{2} \ln f(x) \bigg\rvert_0^{\pi/2}, $$ which for us is $$ -\frac{1}{2} \ln(\sin x + \cos x) \bigg\rvert_0^{\pi/2} = -\frac{1}{2} \left( \ln(1) - \ln(1) \right) = 0. $$

Putting these two together, we see again that ${I = \frac{\pi}{4}}$. ${\spadesuit}$

Leave a comment

Info on how to comment

To make a comment, please send an email using the button below. Your email address won't be shared (unless you include it in the body of your comment). If you don't want your real name to be used next to your comment, please specify the name you would like to use. If you want your name to link to a particular url, include that as well.

bold, italics, and plain text are allowed in comments. A reasonable subset of markdown is supported, including lists, links, and fenced code blocks. In addition, math can be formatted using $(inline math)$ or $$(your display equation)$$.

Please use plaintext email when commenting. See Plaintext Email and Comments on this site for more. Note also that comments are expected to be open, considerate, and respectful.

Comment via email

Comments (3)
  1. 2014-12-03 Jason

    How would anyone think to do either of these?

  2. 2015-01-02 noble-servant

    typo in 3rd display mode equation this one: $$ I = \int_0^{\pi/2}\frac{\sin x}{\sin x = \cos x}dx = \int_0^{\pi/2}\frac{\cos x}{\sin x + \cos x }dx. $$ it should be $$ I = \int_0^{\pi/2}\frac{\sin x}{\sin x + \cos x}dx = \int_0^{\pi/2}\frac{\cos x}{\sin x + \cos x }dx. $$

  3. 2015-01-05 davidlowryduda

    Thank you. I've made the correction. - DLD