Fourier transform of derivative piecewise function Consider the function 
$$f(x) = \begin{cases}(e^x-1)^2 & x < 0 \\ x^2 & x \geq 0\end{cases}$$
I would like to compute the Fourier transform of the fourth derivative, however, I find different results for different approaches to solve this problem:
$$\begin{align}
  \widehat{f^{(4)}}(k) & = \frac{6 (1 + 5 k^2 \pi^2) + 4 \pi k (1 + 7 k^2 \pi^2) i}{(4 k^2 \pi^2 + 1)(k^2 \pi^2 + 1)} \tag{direct} \\
  & \neq 2 \pi k i \cdot \widehat{f^{(3)}}(k) \tag{detour} \\
  & = 2 \pi k i \cdot \frac{2 (1 + 7 k^2 \pi^2) + 12 k^3\pi^3 i}{(4 k^2 \pi^2 + 1)(k^2 \pi^2 + 1)} \\
  & = \frac{-24 k^4\pi^4 + 4 \pi k (1 + 7 k^2 \pi^2) i}{(4 k^2 \pi^2 + 1)(k^2 \pi^2 + 1)} \\
\end{align}$$
I figured this might be because $f^{(4)}$ is discontinuous (so strictly speaking not differentiable, although I could define the derivative to be anything) and thus $\widehat{f^{(4)}}(k) \neq 2 \pi k i \cdot \widehat{f^{(3)}}(k)$, but also $\widehat{f^{(3)}}(k)$ is discontinuous and still $\widehat{f^{(3)}}(k) = 2 \pi k i \cdot \widehat{f''}(k)$. On top of that $f''$ is not integrable, whereas $f^{(3)}$ is, so I would expect this to work even less. 
What am I missing here? Could anyone enlighten me what's happening here?
Disclaimer: Mathematica did most of the computations, I'm not skilled enough to do it by hand.
 A: The difference between the two results is $-6$. This is because it seems that Mathematica compute "incorrectly" $f^{(4)}$.
More precisely you have:
$$f'''(x)=\begin{cases} 8 e^{2x}-2 e^x \text{ if } x \geq 0\\ 0 \text{ if } x<0 \end{cases}=\left(8 e^{2x}-2 e^x \right)  \times 1_{x \leq 0}+0 \times 1_{x>0}$$
so as a distribution:
$$f^{(4)} (x)=\left(16 e^{2x}-2 e^x \right)  \times 1_{x \leq 0}-(8-2) {\color{red} {\delta_0}}+0 \times 1_{x>0}$$
but it seems that in your notebook Mathematica "misses" this Dirac function which and compute instead the Fourier transform of $\left(16 e^{2x}-2 e^x \right)  \times 1_{x \leq 0}+0 \times 1_{x>0}$.
As $\widehat{\delta_0}=1$, this explain that the difference is $-6$.

Here is an other example to see why a Dirac appears. Let:
$$g(x)=\begin{cases} -1/2 \text{ if } x \leq 0 \\ 1/2 \text{ if } x>0 \end{cases}$$
then the Fourier transform is:
$$\widehat{g}(k)=\frac{1}{2i \pi k}$$
but if you differentiate "naively" you obtain:
$$g_{naive}'(x)=\begin{cases} 0 \text{ if } x \leq 0 \\ 0 \text{ if } x>0 \end{cases}$$
so:
$$\widehat{g'_{naive}}(k)=0 \neq 2 i k \pi \times \frac{1}{2i \pi k}$$
But in fact you have:
$$g'(x)=\delta_0(x)$$ so
$$\widehat{g'}(k)=1 = 2 i k \pi \times \frac{1}{2i \pi k}$$
