Solution (source code)

= Solution

Extend $f$ evenly to $F(x)=f(|x|)$ on the whole real line, and use the <Fourier transform> convention $\widehat F(k)=\int_{\mathbb R}F(x)e^{-ikx}dx$. Its odd sine contribution vanishes, giving $\widehat F(k)=2\int_0^\infty f(x)\cos(kx)dx=\widehat f_c(k)$ for $k>0$; the transform is also <even>. The <Fourier inversion theorem> therefore gives, for $x>0$,
$$
f(x)=\frac1{2\pi}\int_{-\infty}^{\infty}\widehat F(k)e^{ikx}dk=\boxed{\frac1\pi\int_0^\infty\widehat f_c(k)\cos(kx)dk}.
$$
This is the inverse <Fourier cosine transform> with the factor-of-two forward convention used here.