# Second distributional derivative of cosine

I need to compute second distributional derivative of the function

$$g(x) = cos|x-2|,$$

but I'm not sure about my solution.

\begin{align} \left<g'', \varphi \right> = \left<g, \varphi''\right> &= \int^{\infty}_{-\infty} \underbrace{cos|x-2|}_u \cdot \underbrace{\varphi''(x)}_{v'} dx \\ &= \Big| \begin{array}{@{}cc@{}} u=cos|2-x| & u'=sin(2-x) \\ v = \varphi'(x) & v'= \varphi''(x) \end{array} \Big|\\ &=\underbrace{\left[ cos|x-2| \cdot \varphi'(x) \right]^\infty_{-\infty}}_0 - \int^\infty_{-\infty} \underbrace{sin(2-x)}_u \cdot \underbrace{\varphi'(x)}_{v'} dx\\ &= \Big| \begin{array}{@{}cc@{}} u=sin(2-x) & u'=- cos(2-x) \\ v = \varphi(x) & v'= \varphi'(x) \end{array} \Big|\\ &= - \underbrace{\left[ sin(2-x) \cdot \varphi(x) \right]^\infty_{-\infty}}_0 + \int^\infty_{-\infty} - cos(2-x) \cdot \varphi(x) dx \end{align}

So, is $- cos(2-x)$ the correct distributional derivative?

• @JeanMarie So you're telling me to divide integral into multiple intervals, where cosine function behaves differently? I thought, that cos|x-2| behaves exactly like cos(x), just shifted to the right... desmos.com/calculator/djg73s8yoi – Eenoku Apr 23 '16 at 22:33
• I am sorry, I withdraw my remark: I had misread $sin|x-2|$ as $|sin(x-2)|$ ... I will even cancel it, not for hiding my misreading, but for readers not being puzzled... – Jean Marie Apr 23 '16 at 22:39
• @JeanMarie It's ok, no problem... Just, what's your opinion now? Is it ok? :-) – Eenoku Apr 23 '16 at 22:41
• @JeanMarie Thank you very much! Could you, please, add this as an answer, so I could accept it? – Eenoku Apr 23 '16 at 22:56
• All right. Nice of you. I will precise something, that I had overlooked – Jean Marie Apr 23 '16 at 23:16

In fact, there is a general result that says that, till its $$n$$th derivative (including it), the distributional derivatives and the ordinary derivatives of a $$C^n$$ function coincide.
In this case where in fact we deal with a $$C^{\infty}$$ function ($$\cos(|x-2|)$$ is identical with $$\cos(x-2)$$), there will be no problem at any order of derivation.