What are you asking here? x(t) can, of course, be any function of t.
In order that you be able to use the "Method of Undetermined Coefficients", it must be one of the types of functions we get as solutions to linear equations with constant coefficients: a constant, a polynomial, an exponential, sine or cosine, or combinations of those.
#3
Nusc
752
2
So if it's not then I just leave it expressed as an integral? I put it into mathematica and it only did just that.
If it is not, then you can use "variation of parameters" which is guarenteed to give the solution in the form u(t)y1(t)+ v(t)y2(t) where y1(t) and y2(t) are solutions to the associated homogeneous equation. You can reduce to integrals for u(t) and v(t). Often those integrals have no closed form solution so you would have to leave them in terms of integrals.
Since the DE given is first order, you don't need to make use of the variation of parameters (though I guess you could - it's just that you'll only have one solution, y1(t), to the associated homogeneous problem). In this case it's easiest to multiply by e^{ikt}, as then the left hand side is a perfect differential and you can write
(e^{ikt}y(t))' = i g x(t) e^{ikt}
at which point you can integrate to get the solution in terms of at least an integral solution (it depends on what x(t) is and if you can integrate it to get a solution in closed form).
Note that this method works for any first order linear ODE: Given
y' + A(x)y = f(x)
if you multiply by p(x), such that p'(x) = A(x)p(x), then you can write the left hand side as (p(x)y(x))', and then you just need to integrate the equation. I forget what this method is typically called.