# Name of the rule allowing the exchanging $\sin$ and $\cos$ in integrals with limits $0$ and $\pi/2$?

As in $$0$$ to $$\frac{\pi}{2}$$ limits the area under curve of $$\sin \theta$$ and $$\cos \theta$$ are same, so in integration if the limits are from $$0$$ to $$\frac{\pi}{2}$$ we can replace $$\sin \theta$$ with $$\cos \theta$$ and vice versa. Example-

\begin{align*} \int\limits_{0}^{\frac{\pi}{2}} \frac{\sin^3x-\cos x}{\cos^3x-\sin x} dx &=\int\limits_{0}^{\frac{\pi}{2}} \frac{\sin^3x-\sin x}{\sin^3x-\sin x} dx\\ &=\int\limits_{0}^{\frac{\pi}{2}}dx\\ &=\frac{\pi}{2} \end{align*}

I want to know what the name of this rule.

I think you want

$$\int_a^b f(x) dx=\int_a^b f(a+b-x) dx$$

If you input $$a=0,b=\pi/2$$, using the above property you can "convert" sines to cosines and vice versa due to $$\sin x=\cos (\pi/2 -x)$$.

But what you have done, as pointed out by others, is not applicable everywhere. If you ''exchange" sines and cosines using the above property, it is totally fine.

There is a rule that allows exchanging sines and cosines (and, generally, trig functions and their respective co-functions), but it requires changing them all ... and possibly making other adjustments for non-trig elements.

The "rule" is simply the $$u$$-substitution $$u=\pi/2-x$$, which we write thusly:

$$\int_0^{\pi/2}f(x) dx = \int_{\pi/2}^0 f\left(\frac\pi2-u\right)(-du) = \int_0^{\pi/2}f\left(\frac\pi2-u\right)du= \int_0^{\pi/2}f\left(\frac\pi2-x\right)dx \tag{\star}$$ where the last step simply replaces the integration variable.

Now, since $$\sin x = \cos(\pi/2-x)=\cos u$$ and $$\cos x = \sin(\pi/2-x) = \sin u$$, the effect of $$(\star)$$ is to "magically" exchange all sines and cosines (and all trig functions and co-functions).

Importantly: Every instance of $$\sin x$$ must be changed to $$\cos x$$, and vice-versa. You don't get to pick and choose. (Also, any non-trigged instances of $$x$$ become $$\pi/2-x$$, which is decidedly non-magical.)

So, use the "rule" with caution.

In particular, the example's replacement of cosines with sines without the vice-versa, is invalid. It is perhaps worth noting that $$\int_0^{\pi/2}\frac{\sin^3 x - \cos x}{\cos^3 x - \sin x}dx$$ is an improper integral (due to a singularity at $$x=0.598\ldots$$). WolframAlpha even times-out trying to evaluate it. Evaluating the integral before and after the problem point and adding the results gives a value of about $$8.71605$$, which is not $$\pi/2$$.

• then Is it totally fine use this in integrating continuous trigonometric functions(if it is valid )? (I just want to use this in multiple choice questions to save some time) Jun 13, 2020 at 5:04
• @SoyebJim: I won't give a blanket statement about what is "totally fine". That said, continuity (or lack thereof) isn't the issue in your problem, although the shift from the discontinuous original function to your continuous (constant) simplification should have raised some warning flags. After all, all that $u$-substitution does is effectively flip graphs across a vertical mirror line; it can't change their (dis)continuous nature ... or even their overall shape (apart from the mirroring). Unless/until you truly understand this effect, I recommend against blindly applying the rule.
– Blue
Jun 13, 2020 at 5:32

I am not sure such a "rule" exists. If I understand what you have said correctly, then we have $$\int_0^{\pi/2}\tan xdx=\int_0^{\pi/2}\frac{\sin x}{\cos x}dx =\int_0^{\pi/2}\frac{\cos x}{\cos x}dx=\pi/2$$ where we used the "rule" in the second equality.

However, $$\int_0^{\pi/2}\tan xdx=-\ln \cos x\Big|_{x=0}^{x=\pi/2}=\infty.$$

This is not a general rule. For example, take $$\int_0^{\frac{\pi}{2}} \frac{\sin(x)}{x} dx \approx 1.3707621$$ and $$\int_0^{\frac{\pi}{2}} \frac{\cos(x)}{x} dx$$ which is undefined.

This is just plain wrong. Indeed, if you evaluate your original integral numerically, you get a negative answer.

What is correct is this: For any continuous function $$f(x,y)$$, it is the case that $$\int_0^{\pi/2} f(\sin\theta,\cos\theta)\,d\theta = \int_0^{\pi/2} f(\cos\theta,\sin\theta)\,d\theta.$$

• Unnecessarily blunt, but correct. Jun 13, 2020 at 3:48

This is actually not a valid rule. To get an intuition why, we can imagine two functions other than sine and cosine that have the same integral over a certain region.

Let the functions be $$f_1(x)=\begin{cases}0 & x\leq1\\ 1 & x>1\end{cases}$$ $$f_2(x)=\begin{cases}1 & x\leq1\\ 0 & x>1\end{cases}$$ Clearly these functions both have an area of 1 when integrated from 0 to 2. But see what happens when we multiply them together: $$f_1(x)f_2(x)=\begin{cases}0\cdot1 & x\leq1\\ 1\cdot0 & x>1\end{cases}=0$$ So if we tried to integrate their product, the answer would clearly be zero, showing that we cannot replace one with the other if they are multiplied together. Similar reasoning follows for division.

This is not a specific rule. It is the property of definite integral: $$\int_a^bf(x)dx=\int_a^bf(a+b-x)dx$$ i.e. substitute $$x=a+b-x$$ everywhere in the integrand as follows $$\int\limits_{0}^{\frac{\pi}{2}} \frac{\sin^3x-\cos x}{\cos^3x-\sin x} dx$$ $$=\int\limits_{0}^{\frac{\pi}{2}} \frac{\sin^3\left(\frac{\pi}{2}-x\right)-\cos\left(\frac{\pi}{2}-x\right)}{\cos^3\left(\frac{\pi}{2}-x\right)-\sin \left(\frac{\pi}{2}-x\right)} dx$$ $$=\int\limits_{0}^{\frac{\pi}{2}} \frac{\cos^3x-\sin x}{\sin^3x-\cos x} dx$$

Using above property in this case is not useful because it's an improper integral.