# Formula to find a particular solution of a specific linear ODE

I'm currently following the book "Differential Equations with Applications and Historical Notes" by George F.Simmons. When he goes on to talk about particular solutions of linear ODEs and how to find them, one of the methods he proposes as a last resort is "Variation of parameters". One of the problems related to that method states the following:

Prove that the method of variation of parameters applied to the equation $y''+y=f(x)$ leads to the particular solution: $$y_p(x)=\int_{0}^x f(t)\sin(x-t)dt \tag{1}$$

This is what I've tried to do. I start from the fact that

$$y_p(x)=y_1v_1 + y_2v_2 \tag{2}$$ Where $y_1$ and $y_2$ are solutions to the homogeneous ODE, while $v_1$ and $v_2$ are functions of $x$ to be determined by the following formulas: $$v_1 = \int \frac{-y_2f(x)}{W(y_1,y_2)}dx \tag{3}$$ $$v_2 = \int \frac{y_1f(x)}{W(y_1,y_2)}dx \tag{4}$$

$W(y_1,y_2)$ is the wronskian.

In my case I've chosen $y_1=\sin(x)$ and $y_2=\cos(x)$, so that $W(y_1,y_2)=-1$.

Using (3) and (4), and substituting into (2), I get:

$$y_p(x)=\sin(x) \int \cos(x)f(x)dx\ - \cos(x)\int \sin(x)f(x) dx \ \$$

But I can't find a way to get to (1). I've tried integration by parts. Also, I'm not familiar with the concept of convolution yet.

$$y_p(x)=\sin(x) \int_0^x \cos(t)f(t)dt\ - \cos(x)\int_0^x \sin(t)f(t) dt =$$
$$\int_0^x \sin(x)\cos(t)f(t)dt\ - \int_0^x\cos(x) \sin(t)f(t) dt =$$
$$\int_0^x[\sin(x)\cos(t)-\cos(x) \sin(t)]f(t) dt =$$
$$\int_0^x \sin(x-t)f(t) dt.$$
$\sin(x-t)=\sin(x)\cos(t)-\sin(t)\cos(x)$