Wednesday, July 22, 2026

Medium Daily Integral Writeup 7/22/22, to draw attention to a calculus property

A neat little calculus theorem, then a practical application.

SPOILER WARNING:  THIS POST CONTAINS A WALKTHROUGH AND DISCUSSES TECHNIQUES OF TODAY (7/22/26)'S MEDIUM DAILY INTEGRAL ON DAILYINTEGRAL.COM.  IF YOU DO NOT WISH TO BE SPOILED, DO NOT LOOK AHEAD.

So I was doing today (7/22/26)'s Medium Daily Integral (the current day's is hosted at https://dailyintegral.com/play/medium), and it was this:

$$I=\int_0^{\frac\pi2}\frac{\sin x^{\cos x}}{\sin x^{\cos x}+\cos x^{\sin x}}\mathrm dx.$$

Credits to Veerane P for submitting this problem to Daily Integral.

Not knowing much about advanced integration techniques, the thing I do to attack the problem is to try a number of different $u$-substitutions.  This included $t=\cos x$ and $t=\sin x$, but neither made things work really nicely.

Integration by parts was the next on my list.  I calculated the derivatives of a number of different things in the equation, like $\sin x^{\cos x}$, $\cos x^{\sin x}$, and these two added together.  But again, they were all very messy, and only made the problem more complicated.

Now what?  I couldn't solve the problem, and turned to my local math group for help.  Here's what I learnt.

Let the function inside the integral be $f(x)$.  Let's look at its graph (under the integration bounds).

So... notice how it seems to have point symmetry around the center of its bounds?  This suggests that the sum of $f(x)$ and $f(\frac\pi2-x)$ should be a constant, and we can take $x=0$ and find that this constant is $1$, so

$$f\left(\frac\pi2-x\right)+f(x)=1.$$

To prove this, we substitute $\frac\pi2-x$ into $f$, and get

$$f(\frac\pi2-x)=\frac{\sin (\frac\pi2-x)^{\cos  (\frac\pi2-x)}}{\sin  (\frac\pi2-x)^{\cos  (\frac\pi2-x)}+\cos  (\frac\pi2-x)^{\sin  (\frac\pi2-x)}},$$

and since $\cos(\frac\pi2-x)=\sin x$ and $\sin  (\frac\pi2-x) = \cos x$, this is

$$f(\frac\pi2-x)=\frac{\cos x^{\sin x}}{\cos x^{\sin x}+\sin x^{\cos x}}$$

which does add up to $1$ with our original $f(x)$.

Integrating both sides of $f\left(\frac\pi2-x\right)+f(x)=1$:

$$\int_0^{\frac\pi2} f\left(\frac\pi2-x\right)+f(x) \mathrm dx=\int_0^{\frac\pi2} 1 \mathrm dx.$$

Evaluating the right side, and breaking the left into 2 integrals:

$$\int_0^{\frac\pi2} f\left(\frac\pi2-x\right)\mathrm dx+\int_0^{\frac\pi2}f(x) \mathrm dx=\frac\pi2.$$

Using $u$-substitution as $u=\frac\pi2-x$ on the left side, with $\mathrm dx=-\mathrm du$ and the bounds being from $u=\frac\pi2-0=\frac\pi2$ to $u=\frac\pi2-\frac\pi2=0$ (we write the negative sign from $\mathrm du$ outside of the integral):

$$-\int_{\frac\pi2}^{0} f\left(u\right)\mathrm du+\int_0^{\frac\pi2}f(x) \mathrm dx=\frac\pi2.$$

Swapping the bounds of the first integral (which negates its value, so drop the negative):

$$\int_{0}^{\frac\pi2} f\left(u\right)\mathrm du+\int_0^{\frac\pi2}f(x) \mathrm dx=\frac\pi2.$$

Now both terms on the left are the original integral!!  This means $2I=\frac\pi2$, and we get $I=\frac\pi4$.

This is generally known as King's Rule; Alecks Sun (a_smart_alecks on AoPS, blog https://artofproblemsolving.com/community/c3602384) pointed me to this handout, which describes this in more detail:

https://static1.squarespace.com/static/59471704440243a2a0adc0e0/t/5ce06f9ad7031b00018e7e00/1558212507453/king+property.pdf

In general, though, this is King's Rule:

For any integrable function $f$ over $[a, b]$ and constant $c$, if

$$f(a+b-x)+f(x)=c$$

for all $x\in[a,b]$, then

$$\int_a^b f(x)\,\mathrm dx=\frac{c(b-a)}{2}.$$

Yet another trick they don't teach in standard calculus classes (not that I've taken one), countless more to go...

No comments:

Post a Comment

3-in-1 Shampoos

I grew up in a country where 3-in-1 shampoos were not that common.  So when I visited a tourism resort there in my hometown, they offered 3 ...