Using the Exponential Response Formula to solve differential equations The Exponential Response Formula (ERF) states that for any differential equation $$P(D)y = e^{rt}$$ (where $P$ is a polynomial with real coefficients, $D$ is a differential operator, and $r$ is a real or complex number), then if $P(r) \neq 0$, a particular solution to the differential equation is given by $$y_{p} = \frac{e^{rt}}{P(r)}$$
I am tasked with solving the following differential equation: $$(D^3+D+3)x=\cos(2t)$$I only have $\cos(2t)$, the real part of $e^{2it}$, so is it safe to assume that the solution would be $$Re[\frac{e^{2it}}{P(2i)}]?$$
Following this logic, the solution would be $$ Re[\frac{\cos(2t) +i\sin(2t)}{-6i+3}].$$
Multiplying the numerator and denominator by the conjugate:
$$\frac{\cos(2t) +i\sin(2t)}{-6i+3}*\frac{-6i-3}{-6i-3}$$
results in $$\frac{-6i\cos(2t) +6\sin(2t)+3\cos(2t)+3i\sin(2t)}{-45}$$
Therefore, taking the real part of the above expression equals $$Re[\frac{-6i\cos(2t) +6\sin(2t)+3\cos(2t)+3i\sin(2t)}{-45}]$$
 which is simply $$\boxed{-\frac{2\sin(2t)+cos(2t)}{15}}$$
Is my solution correct? Please also leave any concerns about my writing, as I am knew to MSE and to writing in MathJax
 A: Note that $P(2i)=-6i+3$
$$\frac{\cos(2t) +i\sin(2t)}{-6i+3}*\frac{-6i-3}{-6i-3}$$
Or more simply
$$\frac{\cos(2t) +i\sin(2t)}{-6i+3}*\frac{6i+3}{6i+3}$$
This results in
$$\frac{6i\cos(2t) -6\sin(2t)+3\cos(2t)+3i\sin(2t)}{45}$$
And finally
$$x_p= \frac {\cos(2t)-2\sin(2t)}{15}$$

Another method
$$(D^3+D+3)x=\cos(2t)$$
$$\implies x_p=\frac 1{(D^3+D+3)}\cos(2t)$$
$$ 3x_p=\frac 1{(1-D)}\cos(2t)$$
$$ 3x_p=\frac {1+D}{(1-D^2)}\cos(2t)$$
$$ 15x_p= ({1+D})\cos(2t)$$
$$ 15x_p= \cos(2t)-2\sin(2t)$$
Can you check the value of the polynomial ? it should be if I am not wrong $-6i+3$
A: It is reasonable to assume that the solution will be of the form $x(t) = a_1 + a_2cos(2t) + a_3sin(2t)$, where $a_1,a_2,a_3 \in \mathbb{R}$ are constants to be determined. 
Let's find the derivatives of $x(t)$:


*

*$Dx(t) = -2a_2sin(2t) + 2a_3cos(2t)$

*$D^2x(t) = -4a_2cos(2t) -4a_3sin(2t)$

*$D^3x(t) = 8a_2sin(2t) - 8a_3cos(2t)$
Let's plug the above into your differential equation $(D^3 + D + 3)x(t) = cos(2t)$, implying:
$8a_2sin(2t)-8a_3cos(2t)-2a_2sin(2t)+2a_3cos(2t)+3a_1+3a_2cos(2t)+3a_3sin(2t)=cos(2t)$. 
Combining terms, we get:
$(3a_2-6a_3)cos(2t) + (6a_2+3a_3)sin(2t) + 3a_1 = cos(2t)$.
This yields:
$3a_2-6a_3=1, \; 6a_2+3a_3=0, \; a_1=0$. You can solve the equations to get $a_2 = 1/15$ and $a_3 = -2/15$.
Thus, $x(t) = \frac{1}{15}cos(2t) - \frac{2}{15}sin(2t)$.
