I know form wolfram alpha: https://www.wolframalpha.com/input/?i=integral+of+abs(sin(x)) that the integral is $-\cos(x)\text{sgn}(\sin(x))$ where sgn$(x)$ is the sign of x, sgn function explained on this link: https://www.wolframalpha.com/input/?i=integral+of+abs(sin(x)) what I do not understand is that the definite integral between $a$ and $b$ of $f(x)$ is $F(b)-F(a)$ so that means that the definite integral between $0$ and $128\pi$ would be $-\cos(100)\text{sgn}(\sin(100)) - (-\cos(1)\text{sgn}(\sin(1)))$ which simplifies to $1.40262117816...$ which makes no sense because if you look at the graph: https://www.desmos.com/calculator/mw6fqfazam makes no sense. can somebody please explain this to me.

  • $\begingroup$ Never trust a computer ;) $\endgroup$ – Dunham Jun 25 '19 at 23:51
  • $\begingroup$ Here is a site to help you format your question. Please use it. $\endgroup$ – Eleven-Eleven Jun 25 '19 at 23:53

Really WolframAlpha is just wrong here. An antiderivative must be absolutely continuous, and $F(x) = -\cos(x)\mathrm{sgn}[\sin(x)]$ isn't. The correct antiderivative (up to an additive constant) is

$$ F(x) = 2\left\lfloor\frac{x}{\pi}\right\rfloor - \cos(x)\mathrm{sgn}[\sin(x)] $$

which is absolutely continuous and satisfies $\int_a^b |\sin(x)|dx = F(b) - F(a)$.

  • $\begingroup$ so what you're saying is that Wolfram alpha is wrong and the correct integral is 2*floor(x/pi) - cos(x)*sgn(sign(x)) ??? $\endgroup$ – Yay Jun 26 '19 at 12:00
  • $\begingroup$ @Yay Yes. While their answer does have the property that its derivative is equal to $|\sin(x)|$ at every place where it's differentiable, their answer is not everywhere differentiable (or even everywhere continuous). This function is differentiable everywhere and everywhere that derivative is equal to $|\sin(x)|$. $\endgroup$ – eyeballfrog Jun 26 '19 at 12:08
  • $\begingroup$ isn't the absolute value of the sin of x everywhere continuous? $\endgroup$ – Yay Jun 27 '19 at 11:07
  • $\begingroup$ @Yay Yes, but $-\cos(x)\mathrm{sgn}[\sin(x)]$ is not. $\endgroup$ – eyeballfrog Jun 27 '19 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.