Can't obtain a continuous function when integrating

58 Views Asked by At

I wish to find a continuous function that solves this integral:

$\int{\lvert\sin{2x}\rvert\sin{2x} \,\,dx}$

or equal written as

$\int{\sqrt{\sin^2{2x}} \, \sin{2x} \,\,dx}$

I have used multiple solvers and even when I make it a definite integral, i.e. $x_1$ to $x_2$, the functions returned are not continuous. I really only need a function that is continuous for a period, i.e. 0 to $\pi$. Any help would be great.

2

There are 2 best solutions below

8
On

Hint

In $[0,\frac{\pi}{2}], \sin (2x)\geq 0$

$$\int \sin^2 (2x)dx=\int \frac{1-\cos (4x)}{2} $$

$$=\frac {x}{2}-\frac{\sin(4x)}{8}+C_1.$$

In $[\frac {\pi}{2},\pi],\sin (2x)\leq 0$,

you add a minus,

to find

$$-\frac {x}{2}+\frac{\sin (4x)}{8}+C_2$$

to be continuous at $[0,\pi]$, you need

$C_2=C_1+\frac {\pi }{2}$.

6
On

If you want an antiderivative for a piecewise defined function, which is what your integrand is, then you shouldn't complain too much when the antiderivative is piecewise defined. There's no way around it: Define

$$f(x) = \begin{cases} \dfrac{x}{2} -\dfrac{\sin (4x)}{8}, & 0\le x \le \frac{\pi}{2}\\ \dfrac{\pi}{2}-\dfrac{x}{2} +\dfrac{\sin (4x)}{8},& \pi/2\le x \le \pi \end{cases} $$

Then $f$ is the unique antiderviative of $|\sin 2x|\sin 2x$ on $[0,\pi]$ with $f(0)=0.$ Now extend $f$ to all of $\mathbb R$ by making $f$ $\pi$-periodic. Then check that $f(x) + C$ is the general antiderivative of $|\sin 2x|\sin 2x$ on $\mathbb R.$