Case 1
$$y''-3y'-4y=15e^{4x}$$
First, the general solution for $$y''-3y'-4y=0$$ is $y_c=C_1e^{4x}+C_2e^{-x}$ and the particular solution for the DE is a linear combination of the terms on the RHS of the DE and their successive derivatives. But in this case, $e^{4x}$ is repeated in the general solution, so that if you simply plug that in, the RHS will be equal to 0 intead.
What I was taught to deal with this is to multiply the repeated term with however many $x$ as to make it no longer repeated. So the particular solution will then be $y_p=Axe^{4x}$. You plug this in to the first equation and find A, the undetermined coefficient.
Case 2
$$x^2y''+xy'-16y=x^4+x^{-4}$$
The general solution for $x^2y''+xy'-16y=0$ is $y_c=C_1x^4+C_2x^{-4}$. Both of the terms of the function on the RHS are repeated.
Now should you still multiply them by $x$ or $lnx$? And why? This question is about case 2.
If you are unsure when it comes to the Euler equations, you can always think (or even do) the change of variables $x=e^t$ (and $u(t)=y(x)$). This will lead to a linear differential equation with constant coefficients, $$ u''(t)+au'(t)+bu(t)=e^{4t}+e^{-4t}. $$ The solution to the corresponding homogeneous differential equation will be (this comes from the actual coefficients $a$ and $b$, but better do the calculation) $$ u(t)=C_1e^{4t}+C_2e^{-4t} $$ The correct ansatz now is (as you seem to know from Case 1) $$ u_p(t)=A t e^{4t}+B te^{-4t}. $$ Finally, this transforms to the ansats