I am sure that a p is unknown function. I have homogenous solution. First derivate of x, constants have a derivate to (because of Lagrange method of variational constants). From this, velocity must be like a first derivate of homogenous solution when constants not have a derivate. We can get first equation from that like f(C1'(t), C2'(t))=0. Third derivate of hom solution can give us one more equation. Second and fourth derivate we can substitute in differential equation, but what to equal in this equation when we didn't know p. And we have 3 equation, and 4 unknown C1', C2',C3',C4'.
So you still need to find the complimentary solution. Suppose that it has the form
Using variation of parameters we can use the wronskian to write a system to be solved.
Now using Cramer's rule we can solve for for the derivative of each of the u's
and continue the pattern to find
Now we can integrate (or write in terms of integrals) the particular solution.
"Undetermined Coefficients" works as long as p(t) is one of the kinds of functions we expect as a solution to a linear equation with constant coefficients- exponentials, sine and cosine, polynomials and products of those.
For a general p(t), us "variation of parameters": If and are two independent solutions to the associated homogeneous equation, look for a solution to the entire equation of the form . The derivative of that is . In fact, there are an infinite number of such solutions. We "narrow the search" but adding the requirement that the terms involving derivatives of u and v sum to 0: .
Now we have and, differentiating again, . When we put those into the original differential equation, those terms involving u and v, rather than u' and v', will cancel. That is because, since u and v are not being differentiated, they are "like constants" and any constants times and satisfy the associated homogeneous equation.
That means that we get an equation involving only known functions, p(t) and and and their derivatives, with "unknowns", u' and v'. That, together with the equation gives two equations that can be solved algebraically for u' and v'.