# Antiderivative of an odd function

Is the antiderivative of an odd function even?

The answer given by the book is yes.
However, I found a counterexample defined in $$\mathbb{R}\setminus \{0\}$$: $$f(x)=\begin{cases}\ln |x|+1& x<0\\\ln |x|&x>0\end{cases}$$ Its derivative is $$\frac 1x$$, which is an odd function.

Question: is my counterexample right?

• I think the question implies that the odd function in question must contain $0$ in its domain. Otherwise, you can't integrate it across a symmetric interval – Dylan Dec 17 '18 at 6:56
• You can actually do this for any odd function if you allow a piecewise function definition, as there are infinitely many anti-derivatives for a given function --- simply pick two that differ by a constant, then piece them together. E.g. consider $F(x) = x^4 + [x>0]$, where $[\cdot]$ is the Iverson bracket (equal to $1$ when the condition is true, otherwise $0$), which is an antiderivative of $f(x) = x^3$. – apnorton Dec 17 '18 at 7:19
• @apnorton I don't think so. Your $f(x)$ is not differentiable at $x=0$, it contradicts with the definition of antiderivative. – Kemono Chen Dec 17 '18 at 7:23
• $x^2 + C$ is even for any $C$. For the opposite case of whether the antiderivative of an even function is odd, this point would be valid. – badjohn Dec 17 '18 at 11:28
• @1123581321 Constants are even. – Dylan Dec 17 '18 at 19:19

I think that $$f$$ should be defined on an interval $$I$$ which contains $$0$$ and is symmetric to $$0$$. If $$F$$ is an antiderivative of $$f$$ on $$I$$, then there is a constant $$c$$ such that
$$F(x)=\int_0^x f(t) dt+c.$$
If you now calculate $$F(-x)$$ with the substitution $$s=-t$$ you will get $$F(-x)=F(x).$$
• @lalala If $f(t)=\sin(t)$ then $\int_0^x f(t) \,dt = 1-\cos(t)$. Choose a $c$ such as $-1$ or if you prefer $1$ and do as Fred suggests to find $F(-x)$. What do you get? – Henry Dec 17 '18 at 13:13