# Calculate $\int_0^{5p} f(x) dx$ for period $p$.

Let the $$p$$ be a period of the $$f(x)$$

$$f(x) = |\sin x + \cos x|$$

Find the $$S = \int_0 ^{5p } f(x) dx$$

Here is my attempt. The answer is $$10 \sqrt2:$$

But whenever I did the answer dosen't come at all.

Is the answer not correct, isn't it?

• $\cos (x + \pi) \neq \cos(x)$ – Riquelme Aug 14 at 8:23
• Hmm I will try it again – se-hyuck yang Aug 14 at 8:25
• If $f$ is a periodic function with period $p$, then $\int_y^{y+mp} f(z)dz$ will be independent of choice of $y$ for any integer $m$, you can compute your integral over a interval more convenient, e.g. $(-\frac{\pi}{4},-\frac{\pi}{4}+5\pi)$. – achille hui Aug 14 at 8:26
• Clearly $S=5\int_0^pf(x)\,dx$. And, by periodicity $\int_0^\pi f=\int_{-\pi/4}^{3\pi/4}f$, an interval where you can ignore the absolute values. – Jyrki Lahtonen Aug 14 at 8:27
• @Riquelme But $|\cos(x+\pi)|=|\cos x|$. – Jyrki Lahtonen Aug 14 at 8:28

It might be simpler to just write \begin{align} S &=\int_0^{5\pi}|\sqrt{2}\sin{(x+\pi/4)}|\mathrm{d}x\\ &=5\int_0^{\pi}|\sqrt{2}\sin{(x+\pi/4)}|\mathrm{d}x\\ &=5\left(\int_0^{3\pi/4}\sqrt{2}\sin{(x+\pi/4)}\mathrm{d}x-\int_{3\pi/4}^{\pi}\sqrt{2}\sin{(x+\pi/4)}\mathrm{d}x\right)\\ &=\cdots\\ \end{align}