# Will the graphs of equivalent indefinite integrals always look identical?

I came across the following indefinite integral

$$\int {\sqrt{1-\sin{\left(2x\right)}}}\space \mathrm{d}x \space (0 \leq x \leq \pi )$$

I attempted to solve it as follows:

$$u = 1 - \sin\left(2x\right) \implies \sin\left(2x\right) = 1- u$$

$$\implies x = \dfrac{\arcsin\left ( 1 - u\right)}{2} \implies \mathrm{d}x = \dfrac{-\mathrm{d}u }{2 \sqrt{1- (1-u)^2} }$$

$$\therefore \textrm{ we have }\space \dfrac{-1}{2} \int \dfrac{ \sqrt{u} } {\sqrt { 1 - (1 - u)^2}} \space \mathrm{d}u = \dfrac{-1}{2} \int \sqrt {\dfrac{ u } { 1 - (1 -2u + u^2)}} \space \mathrm{d}u$$

$$= \dfrac{-1}{2} \int \sqrt {\dfrac{u} {u(2-u)}} \space \mathrm{d}u = \dfrac{-1}{2} \int \sqrt {\dfrac{ 1 } { 2-u}} \space \mathrm{d}u$$

Let $$z = 2 - u$$. Then $$\mathrm{d}z = -\mathrm{d}u$$

$$\implies \dfrac{1}{2} \int \sqrt {\dfrac{ 1 } {z}} \space \mathrm{d}z = \dfrac{1}{2} \int z^{-1/2}= \sqrt{z} + C = \sqrt{2-u} + C = \sqrt{1 + \sin\left(2x\right)} + C$$

I ran the problem through the site Integral Calculator and got

$$\int {\sqrt{1-\sin{\left(2x\right)}}}\space \mathrm{d}x = -\sin{x} - \cos{x} + C$$

which only coincides with my solution if I take its absolute value. Refer to the image below:

$$\sqrt{1 + \sin\left(2x\right)} + C$$ is in orange, whereas $$-\sin{x} - \cos{x} + C$$ is in purple. In the diagram, $$C = 0$$. The shaded region is the given range of $$x$$ values : $$0 \leq x \leq \pi$$.

Now, from what I know, the graphs of equivalent indefinite integrals should look similar and should differ only by a constant, which means they will coincide after a translation transformation. However, it seems not to be the case here. Hence my question; will the graphs of equivalent indefinite integrals always look similar, or perhaps there is a mistake in my calculations? In addition, the answer that is given in the problem book is

$$2\sqrt{2} \left[ \dfrac{t}{\pi}\right] + \sqrt{2} \space \mathrm{sgn} \space t \cdot \left\{ \cos{ \dfrac{t}{\pi} } - \cos{t}\right\} \\ \mathrm{ where } \space t = x - \dfrac{\pi}{4} \space \mathrm{ and } \left[ \cdot \right] \textrm{ is the integer part of the expression inside }$$

This further confused me because now I don't know the right answer and where I went wrong. Any help is appreciated.

• (1) For a continuous function $f$ on an interval, any two anti-derivatives of $f$ differ only by constant. So their graphs are just vertical translations of each other. Let me also remind you that this is exactly why we consider 'constant of integration'. (2) Since you are integrating non-negative function, its anti-derivarive is always increasing. That said, neither of your answer nor the software's answer correctly represents the anti-derivative of $\sqrt{1-\sin(2x)}$ over $0\leq x\leq\pi$. Check Quanto's answer below to learn how to work with piecewise-defined functions under integraion. – Sangchul Lee Oct 7 '19 at 15:28

Note that the integration is over a periodic function with periodic non-differentiable points as shown in the plot. Follow the steps below to perform such indefinite integration.

$$I=\int {\sqrt{1-\sin{\left(2x\right)}}}\space \mathrm{d}x = \int {\sqrt{(\sin{x} - \cos{x})^2 }}\space \mathrm{d}x$$

$$= \int |\sin{x} - \cos{x}| \mathrm{d}x =\sqrt 2 \int |\sin(x-\frac{\pi}{4})| \mathrm{d}x = \sqrt 2\int |\sin t|dt$$

where the variable change $$t=x-\frac \pi4$$ is made in the last step. Note that the last expression is a positive periodic function with periodity $$\pi$$ and its repeated integral value in each periodic interval is given by

$$A=\int_0^\pi |\sin t| dx = 2$$

Then, for $$t\ge 0$$, reeexpress the integral as,

$$I =\sqrt 2 \int_0^{[\frac t\pi]} |\sin s| ds+\sqrt 2 \int_{[\frac t\pi]}^t \sin s ds + C$$

$$=\sqrt 2 A\left[\frac t\pi\right] - \sqrt 2 \cos s|_{[\frac t\pi]}^t + C$$

$$=2\sqrt{2} \left[ \dfrac{t}{\pi}\right] + \sqrt{2} \space \left( \cos{ \dfrac{t}{\pi} } - \cos{t}\right) +C$$

The result for $$t<0$$ can be derived similarly. The combined integral result then reads,

$$I = 2\sqrt{2} \left[ \dfrac{t}{\pi}\right] + \sqrt{2} \space \mathrm{sgn} \space t \cdot \left(\cos{ \dfrac{t}{\pi} } - \cos{t}\right) +C$$

• Thanks. Though I'm now clear on how the book's answer was derived, I still don't understand why this method was opted for. Could you kindly elaborate? That is, why are the other two solutions in the post incorrect? Is it because of the periodic non-differentiable points? – E.Nole Oct 7 '19 at 15:16
• Yeah, mainly due to periodicity and non-differentiability at those periodic points. As can be seen in the plot, the integral shall grows with $t$ steadily with repeated local variation. The first method in the post is only valid within certain domain due to the use of $\sin^{-1}(x)$ and the second is plain wrong since it assumes the antiderivative is differentiable to all orders. – Quanto Oct 7 '19 at 15:32