Let's consider the differential equation $\ddot{x}+x=F_0 \cos \omega t$ with $x(0)=a $ and $\dot{x}(0)=b$.
If we look at the particular solution using method of undetermined coefficients, we have $x_d(t)=\frac{F_0 }{1-\omega^2}\cos\omega t$, so that $x_d(0)=\frac{F_0}{1-\omega^2}$
Now let us try to calculate the same thing using Green's function approach.
The Green's function for the above differential equation is $G(t,t')=\Theta(t-t')\sin(t-t')$, where $\Theta(t)$ is heaveside function so that
$x_d(t)=\int_0^\infty du G(t,u)F_0\cos\omega u $ which is $F_0\int_0^tdu\sin(t-u)\cos \omega u $.
If we use the equation above for $x_d(t)$ then $x_d(0)=0$.
Q- why are both the methods not agreeing? The method of undetermined coefficients is fine. What is the problem with Green's function approach?
A reference for the green function used:
Any solution can serve as particular solution. It is no wonder that different methods result in different solutions. The difference of two different solutions is a homogeneous solution.
Let's bring both approaches on an equal footing and consider the initial conditions $x(0)=x'(0)=0$. The variations-of-constants solution already satisfies this.
The first solution has $x_d'(0)=0$, so that the additional homogeneous part has only to account for the value $x_d(0)$ itself. The modified solution is $$ x_d(t)=\frac{F_0}{1-ω^2}(\cos(ωt)-\cos(t)) $$
The integral of the second solution can be solved, \begin{align} \frac{F_0}2&\int_0^t[\sin(t−u+ωu)+\sin(t−u-ωu)]du \\ &=\frac{F_0}2\left[\frac{\cos(-t+(1-ω)u)}{1-ω}+\frac{\cos(-t+(1+ω)u)}{1+ω}\right]_{u=0}^t \end{align} which evaluates, as expected for the same IC, to the same as in the first case.