# Function even or odd?

While determining fourier series expansion of following function.

f(x) = $\sqrt{1-\cos x}$

here $f(-x) = f(x)$ so it is even. But

the above function can also be written as $f(x) = \sqrt 2\sin(x/2)$

here $f(-x) = -f(x)$ so by that logic it is odd

Can anyone explain where I am wrong. Thanks in advance

• Yes: $\sqrt{A^2}=\lvert A\rvert$. Aug 19, 2016 at 13:31
• @ raj Please check my edit/formatting. To take your notation literally, we have $\sqrt 2\sin(x/2)$. But did you mean \sqrt{2\sin(x/2)} = $\sqrt{2\sin(x/2)}$? Aug 19, 2016 at 13:38
• No the original notation is correct, and now i understand where i went wrong thank you Aug 19, 2016 at 13:40
• $cos(x)$ is even, so? Aug 19, 2016 at 13:43
• we can also write $\sqrt{1-\cos x}$ as $\sqrt 2\sin(x/2)$ and sin is odd function because of which I was confused Aug 19, 2016 at 13:49

As said @Bernard in a comment, $\forall A\in\Bbb R,\sqrt{A^2}=|A|$.

Hence $$f(x)=\sqrt{2}\sqrt{\sin^2(x/2)}=\sqrt{2}|\sin(x/2)|$$ and you can check that $f$ is even.

• $\sqrt{A^2}\,\,$
– user307169
Aug 19, 2016 at 13:41
• Thank you I understood where i went wrong Aug 19, 2016 at 13:51
• Why $\sqrt(A^2)=|A|$?@paf Aug 19, 2016 at 14:09
• If $A<0$, then $\sqrt{A^2}=-A$ (e.g. $\sqrt{(-3)^2}=\sqrt{9}=3$).
– paf
Aug 19, 2016 at 14:12
• Square root is the inverse of squaring only on positive numbers.
– paf
Aug 19, 2016 at 14:39