We were given a differential equation problem and it is somehow mind-boggling that it needed a particular solution. The general solution itself is already very long; let alone a particular solution. Here's the problem. We had to solve:
$$\begin{cases} x^2(y''-2y'+10y)'' - x(x+4)(y''-2y'+10y)'+2(x+3)(y''-2y'+10y)=0 \\ y(1) = 0, y'(1) = 0, y''(1) = -1, y^{(3)}(1)=25 \end{cases}$$
Is there a better way to solve this? I find my solution pretty ugly. Attached in this post is what I got as the general solution. I had to use WolframAlpha for this because the given is so ridiculous.



This is how I would approach it.
Looking at the equation $$ x^2 a'' - (x+4) xa' + 2 (x+3)a = 0, $$ $x^2a''$ and $x a'$ make me want to try a solution of the form $a(x) = x^n b(x)$. Plugging this in and doing some algebra gives $$ x^2 (b''-b') + (n-2)[2x b'+(n-x-3)b] = 0 $$ Choosing $n = 2$ gives $b'' - b' = 0$, which easily solves to $b(x) = C_2 + C_3 e^x$. So we have $a(x) = x^2(C_2+ C_3 e^x)$. We can then use $a = y'' - 2y' + 10$ and the initial conditions to determine $C_2$ and $C_3$. We have that $a(1) = y''(1) - 2 y(1) + 10y(1) = -1$ and $a'(1) = y'''(1) -2y''(1) + 10 y(1) = 27$. Since $a(1) = C_2 + e C_3$ and $a'(1) = 2 C_2 + 3 e C_3$, we can solve the linear equations to get $C_2 = -30$ and $C_3 = 29/e$. Thus the full solution for $a$ is $$ a(x) = -30x^2 + 29x^2e^{x-1}. $$
We return to the differential equation for $y$, now given by $$ y''-2y' + 10 y = -30x^2 + 29x^2e^{x-1}. $$ First, we use variation of parameters to find the particular solutions. For the $x^2$ term, choose a quadratic for $y_2$. You can plug it in and solve to get $y_2(x) = -3(x-1/5)(x+3/5)$. For the other term, choose $y_3$ of the form $(ax^2 + bx + c)e^x$ and repeat to get $y_3(x) = 29/81(9x^2 -2)e^{x-1}$. The homogeneous equation is easily solved, so all that's left is to apply the remaining initial conditions. For this, it will be convenient to express things in terms of $u = x-1$, so that the conditions apply at $u = 0$. We have $$ y(u) = C_0e^{u}\cos(3u) + C_1e^{u}\sin(3u) -3\left(u+\frac{4}{5}\right)\left(u+\frac{8}{5}\right)+\frac{29}{81}(9u^2+18u+7)e^u \\ y(0) = C_0 - \frac{96}{25}+\frac{203}{81} = 0\Longrightarrow C_0 = \frac{2701}{2025}\\ y'(0) = C_0 + 3 C_1 - \frac{36}{5} +\frac{725}{81} = 3C_1 +\frac{694}{225} = 0\Longrightarrow C_1 = -\frac{694}{675} = -\frac{2082}{2025}. $$ This gives $$ y(x) = e^{x-1}\frac{2701\cos(3x-3) -2082\sin(3x-3)}{2025} -3\left(x-\frac{1}{5}\right)\left(x+\frac{3}{5}\right)+\frac{29}{81}(9x^2 - 2)e^{x-1}. $$ It's not the simplest of functions, but it satisfies the boundary conditions and satisfies $y''- 2y'+10 y = e^{x}(e^{-x}y)'' + 9 y = C_2 x^2 + C_3 x^2 e^{x-1}$. (I use the alternate form of the differential operator to stay under WolframAlpha's character limit.)
Also, despite the messiness, your answer is actually equivalent to this. The key is to notice that $$ \frac{C}{81}\left[(9x^2-2)\sin(3x) + 6x\cos(3x)\right] e^{x}\sin(3x) - \frac{C}{81}\left[(2-9x^2)\cos(3x) + 6x\sin(3x)\right]e^{x}\cos(3x) \\ = \frac{C}{81}\left[\sin^2(3x)+\cos^2(3x)\right](9x^2-2)e^x + \frac{C}{81}\left[\sin(3x)\cos(3x)-\cos(3x)\sin(3x)\right]6x e^x\\ = \frac{C}{81}(9x^2-2)e^x $$ And similarly for the $A$ term.