Finding the first and second derivative of y particular:

$\displaystyle

y_P' = \alpha cos(4x) - 4\alpha xsin(4x) + \beta sin(4x) + 4\beta xcos(4x)

$

$\displaystyle

y_P'' = -8\alpha sin(4x) + 8\beta cos(4x) - 16\alpha xcos(4x) - 16\beta xsin(4x)

$

Then, when I try to compile all of this, to then equate coefficients and solve for alpha and beta, I realise that the x terms do not cancel out (as they should) and I cannot go any further (I don't think).

It will eventually look like this:

$\displaystyle

-8\alpha sin(4x) + 8\beta cos(4x) - 16\alpha xcos(4x) - 16\beta xsin(4x)

$

$\displaystyle

+ 6\alpha cos(4x) - 24\alpha xsin(4x) + 6\beta sin(4x) + 24\beta xcos(4x)

$

$\displaystyle

+ 25\alpha xcos(4x) + 25\beta xsin(4x) = -292sin(4x)

$

Have I made an error somewhere?

Any help is appreciated.

NB: It may/may not help, but in the previous part of the question we've already proved that when:

$\displaystyle

x=0, \frac{dy}{dx}=-2

$