0

Logically because $\sin$ is positive in the given limits, I thought the answer would be the same as integral of $\sin x$ for the given limits (without mod). By calculating it that way I got $2$ which is wrong according to the answers. What did I do wrong?

IraeVid
  • 3,216

1 Answers1

1

The expression $\int_0^{\pi}|\sin(x)|dx$ can be calculated by analysing the integrand function. $\sin(x)$ has solutions at all $x$ where $x=k\pi\{k\in Z\}$. Since $\sin(x)$ is continuous ($\lim_{h\to x}f(h)=f(x)$), we know that between two solutions, all answers are positive ($|\sin(x)|=\sin(x)$) or negative ($|\sin(x)|=-\sin(x)$).

Since the integral in question is between $0\pi$ and $\pi$, we know that all values of $\sin(x)$ in that range will be positive or negative. We can sample the function anywhere strictly within the range (say at $\pi/2$) and find that it is positive, meaning that $|\sin(x)|=\sin(x)$.

That means instead of calculating the integral $\int_0^{\pi}|\sin(x)|dx$, we can calculate the much simpler integral $\int_0^{\pi}\sin(x)dx$. Now, we can use the common integral $[-\cos(x)]_0^{\pi}$, evaluate, and get $2$. I'm not sure what software you're using that's telling you otherwise, but it might be a bug in the software, or an issue of the input.

gt6989b
  • 54,422
  • $\int_0^\pi |\sin x| dx$ is not an equation... – gt6989b Jul 30 '23 at 05:12
  • Sorry. I meant to say expression. – Sig Moid Jul 30 '23 at 05:32
  • I did the exact same thing (didn’t show my work because I thought it was obvious). And I’m not using software, this was a test question and I was referring to the given answer key. Thank you! – Silverstreak Jul 30 '23 at 05:36
  • @Silverstreak I'm glad I could help! – Sig Moid Jul 30 '23 at 05:38
  • "We can sample the function anywhere strictly within the range (say at π/2) and find that it is positive," is not mathematics : it is experimental science... You must say : $\sin(x) \ge 0$ for $x \in [0,\pi]$ because in this range it is the ordinate of a point which is in the first and second quadrant. – Jean Marie Jul 30 '23 at 05:47
  • @JeanMarie I am aware that $sin$'s sign is determined by the quadrant of it's ordinate point $(cos(x), sin(x))$. I was just using a simpler explanation that still works for continuous functions between two solutions. It still proves the point, and I'm not sure what you mean by it "not [being] mathematics." – Sig Moid Jul 30 '23 at 15:09
  • All right : this explanation is a good one ; nevertheless, I maintain that using the verb "to sample" is not appropriate. – Jean Marie Jul 30 '23 at 15:19
  • @JeanMarie It's a bit like if you're at a buffet, and you want to know if a particular item is good––so you sample a teeny amount of it to make an inference about the whole item. – Sig Moid Jul 30 '23 at 17:55