I am not sure I understand your question properly, since it lacks some details.
I guess you have a linear partial differential equation with a periodic forcing term. You can in theory expand the initial condition and the forcing terms in Fourier series and in this way solve the pde. This method is often known as "separation of variables"; a good reference book with examples is "Separation of Variables for Partial Differential Equations: An Eigenfunction Approach" by Cain and Meyer (link below).
Thank you Philippe. I want to solve a forced equation of motion with superposition method and the force must be an arbitrary one, e.g. ground motion. But I don't know which method is appropriate to use, duhamel integral or FFT?
I want to find response (natural frequency and mode shapes) of an undamped, multi degree of freedom(MDOF) system (pile-soil-structure) to the arbitrary excitation. It's a soil-structure interaction problem and I want to solve it with finite element method. the problem is how to produce the force matrice?
This seems to be a completely different question, now you are talking about numerical analysis (FEM) and modeling. As I said, it is very difficult to answer without the specifics of your problem. Also, have you conducted a preliminary bibliographic search, as there is quite a number of papers on this topic.