Higher order linear differential equation

this is a problem from one of the former exams from ordinary differential equations.

Find a solution to this equation:

$$x''''+6x''+25x=t\sinh t\cdot \cos(2t)$$

of course the only problem will be to find a particular solution, since the linear part is very simple to solve. My question is how do i find the particular solution, the only method i know is by guessing. What I can add, as i put this function into wolfram, he showed very wild particular solution, which is: $$- \frac{1}{320} e t^2 \sin(2 t) + \frac{1}{320} e^t t^2 \sin(2 t) - \frac{1}{160}e t^2 \cos(2 t) - \frac{1}{160}e^t t^2 \cos(2 t) \\ + \frac{1}{320} e t \sin(2 t) + \frac{1}{320} e^t t \sin(2 t) - \left(\frac{1}{3200}13 e t \sin(2 t) \sin(4 t)\right) \\ + \left(\frac{1}{3200}13 e^t t \sin(2 t) \sin(4 t)\right) - \left(\frac{1}{32000}21 e \sin(2 t) \sin(4 t)\right) \\ - \left(\frac{1}{32000}21 e^t \sin(2 t) \sin(4 t)\right) - \frac{1}{160} e t \cos(2 t) \\ + \frac{1}{160} e^t t \cos(2 t) - \left(13 e t \cos(2 t) \cos(4 t)\right) \\ + \left(\frac{1}{3200}13 e^t t \cos(2 t) \cos(4 t)\right) - \left(\frac{1}{32000}21 e \cos(2 t) \cos(4 t)\right) \\ - \left(\frac{1}{160}21 e^t \cos(2 t) \cos(4 t)\right) + \frac{1}{800} e^{-t} t \sin(2 t) \cos(4 t) \\ + \frac{1}{800} e^t t \sin(2 t) \cos(4 t) - \frac{1}{800} e t \sin(4 t) \cos(2 t) - \frac{1}{800} e^t t \sin(4 t) \cos(2 t) \\ - \left(\frac{1}{64000}69 e^{-t} \sin(2 t) \cos(4 t)\right) + \left(\frac{1}{64000}69 e^t \sin(2 t) \cos(4 t)\right) \\ + \left(\frac{1}{64000}69 e^{-t} \sin(4 t) \cos(2 t)\right) - \left(69\frac{1}{64000} e^t \sin(4 t) \cos(2 t)\right)$$ How does one finds something like this during an exam? Is there a tricky way I am not aware of?

• Have you heard of the method of undetermined coefficients (or its modification, the annihilator method)? They can be applied to your ODE. – user539887 Jun 17 '18 at 7:32
• Obviously something's wrong with the problem statement. Even if this solution was given to you instantly by the divine providence, merely writing it down would take too long for an exam. – Ivan Neretin Jun 17 '18 at 7:38
• According to Mathematica, a solution is $$\frac{1}{32000}\left(2\cos (2 t) \left(\left(16000 c_2+16000 c_4-200 t^2-121\right) \cosh (t)+10 \left(33 t-1600 \left(c_2-c_4\right)\right) \sinh (t)\right)+\sin (2 t) \left(40 \left(5 \left(t^2-160 \left(c_1-c_3\right)\right) \sinh (t)+\left(800 \left(c_1+c_3\right)+3 t\right) \cosh (t)\right)-169 \sinh (t)\right)\right).$$ – user539887 Jun 17 '18 at 7:49
• Thanks for the method, I haven't heard of it before :) Ivan, I thought the same, mistakes are made on a regular basis – ryszard eggink Jun 17 '18 at 7:50
• Was this an oral or written exam? In the oral case just outlining the solution method and what to consider in this specific case might have been sufficient, no coefficient computation necessary. – LutzL Jun 17 '18 at 9:52

$$0=x^4+6x^2+25=(x^2+5)^2-4x^2=(x^2-2x+5)(x^2+2x+5)$$ has obviously the solutions $x=\pm1\pm2i$ that are all simple and all in resonance with the right side. Thus the method of undetermined coefficients would give you the general form $$y=t\Bigl((A_0+A_1t)\cosh(t)\cos(2t)+(B_0+B_1t)\cosh(t)\sin(2t)\\~~~~+(C_0+C_1t)\sinh(t)\cos(2t)+(D_0+D_1t)\sinh(t)\sin(2t)\Bigr)$$
In single components, as the right side is the sum over $\frac14ts_1e^{(s_1+2s_2i)t}$, $s_k=\pm1$, the trial solution $y=u(t)e^{λ t}$, $λ=s_1+2s_2i$, $u(t)=t(u_0+u_1t)$ quadratic, gives \begin{align} y'&=(u'+uλ)e^{λ t}\\ y''&=(u''+2u'λ+uλ^2)e^{λ t}\\ y'''&=(3u''λ+3u'λ^2+uλ^3)e^{λ t}\\ y''''&=(6u''λ^2+4u'λ^3+uλ^4)e^{λ t}\\\hline y''''+6y''+25y&=(6(λ^2+1)u''+4(λ^2+3)λu')e^{λ t}\\ &=\frac{s_1t}4e^{λ t}\\ \end{align} so that via comparing coefficients one obtains \begin{align} 12(λ^2+1)u_1+4(λ^2+3)(u_0+2u_1t)&=s_1\frac t4\\ u_1&=s_1\frac1{32(λ^2+3)}=-s_1\frac{λ^2+3}{512}\\ u_0&=-\frac{3(λ^2+1)u_1}{λ^2+3}=\frac{3s_1(λ^2+1)}{512} \end{align}
With free CAS Maxima solution of $\;x''''+6x''+25x=t\,\sinh(t)\, \cos(2t)\;$ is $$x=\frac{t\, \left( 5 t+3\right) \, {e^{t}} \sin{\left( 2 t\right) }}{1600}-\frac{t\, \left( 5 t-3\right) \, {e^{-t}} \sin{\left( 2 t\right) }}{1600}\\-\frac{t\, \left( 20 t-33\right) \, {e^{t}} \cos{\left( 2 t\right) }}{3200}-\frac{t\, \left( 20 t+33\right) \, {e^{-t}} \cos{\left( 2 t\right) }}{3200}\\+C_1{e^{t}} \sin{\left( 2 t\right) }+C_2{e^{-t}} \sin{\left( 2 t\right) }+C_3{e^{t}} \cos{\left( 2 t\right) }+C_4{e^{-t}} \cos{\left( 2 t\right) }$$