1

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.

1 Answers1

6

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)], $$

with $F(x) = x - 1 $ for integer $x$. This is absolutely continuous and satisfies $\int_a^b |\sin(x)|dx = F(b) - F(a)$.

eyeballfrog
  • 23,323
  • so what you're saying is that Wolfram alpha is wrong and the correct integral is 2floor(x/pi) - cos(x)sgn(sign(x)) ??? – Ekadh Singh Jun 26 '19 at 12:00
  • @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)|$. – eyeballfrog Jun 26 '19 at 12:08
  • isn't the absolute value of the sin of x everywhere continuous? – Ekadh Singh Jun 27 '19 at 11:07
  • @Yay Yes, but $-\cos(x)\mathrm{sgn}[\sin(x)]$ is not. – eyeballfrog Jun 27 '19 at 14:50
  • @eyeballfrog is $F(x)$ absolutely continuous? For $\lim_{x\rightarrow 0} F(x) = -1$ but $F(0) = 0$. – rb612 Dec 13 '20 at 00:16
  • @rb612 Ah yes, there's a removable discontinuity at each integer because of how $\lfloor x \rfloor$ is defined at integers. Should fix that. – eyeballfrog Apr 06 '21 at 16:24