Method of undetermined coefficients or variation of parameters