When it comes to the method of undetermined coefficients, I am having a difficult time figuring out which homogeneous equation to assume when it comes to nonhomogeneous differential equations.
For example, given the equation: $y'''-4y''+3y'=x^2$,
we can find the homogeneous solution by using: $m^3-4m^2+3m=0$
This gives us roots of: $m_1 = 0, m_2=1, m_3=3$
for a homogeneous equation of: $y_h(x)=C_1 + C_2e+C_3e^3$
However,
$y'' + 4y = 0$
with roots of $m=+/-i$
requires a homogeneous equation of: $y_h(x)=C_1cos(2x)+C_2sin(2x)$
How am I supposed to find homogeneous equations of any given nonhomogeneous differential equations using the method of undetermined coefficients? Is this just something I have to remember for each type of nonhomogeneous equation?