How do I find out particular solution for my differential equation? How do I find out particular solution for my differential equation?
For example $\ddot{x}+4\dot{x}+4x=t+1+\sin t$.
Can someone explain me why is particular solution here $x_p(t)=At+B+C\sin t+D\cos t$?
 A: Use Laplace transform:
$$x''(t)+4x'(t)+4x(t)=1+t+\sin(t)\Longleftrightarrow$$
$$\mathcal{L}_t\left[x''(t)+4x'(t)+4x(t)\right]_{(s)}=\mathcal{L}_t\left[1+t+\sin(t)\right]_{(s)}\Longleftrightarrow$$
$$\mathcal{L}_t\left[x''(t)\right]_{(s)}+\mathcal{L}_t\left[4x'(t)\right]_{(s)}+\mathcal{L}_t\left[4x(t)\right]_{(s)}=\mathcal{L}_t\left[1\right]_{(s)}+\mathcal{L}_t\left[t\right]_{(s)}+\mathcal{L}_t\left[\sin(t)\right]_{(s)}\Longleftrightarrow$$
$$\mathcal{L}_t\left[x''(t)\right]_{(s)}+4\cdot\mathcal{L}_t\left[x'(t)\right]_{(s)}+4\cdot\mathcal{L}_t\left[x(t)\right]_{(s)}=\mathcal{L}_t\left[1\right]_{(s)}+\mathcal{L}_t\left[t\right]_{(s)}+\mathcal{L}_t\left[\sin(t)\right]_{(s)}\Longleftrightarrow$$

Now, use:


*

*$$\mathcal{L}_t\left[1\right]_{(s)}=\frac{1}{s}$$

*$$\mathcal{L}_t\left[t\right]_{(s)}=\frac{1}{s^2}$$

*$$\mathcal{L}_t\left[\sin(t)\right]_{(s)}=\frac{1}{1+s^2}$$

*$$\mathcal{L}_t\left[x(t)\right]_{(s)}=\text{X}(s)$$

*$$\mathcal{L}_t\left[x'(t)\right]_{(s)}=s\text{X}(s)-x(0)$$

*$$\mathcal{L}_t\left[x''(t)\right]_{(s)}=s^2\text{X}(s)-sx(0)-x'(0)$$


$$\left(s^2\text{X}(s)-sx(0)-x'(0)\right)+\left(4s\text{X}(s)-4x(0)\right)+\left(4\text{X}(s)\right)=\left(\frac{1}{s}\right)+\left(\frac{1}{s^2}\right)+\left(\frac{1}{1+s^2}\right)\Longleftrightarrow$$
$$\text{X}(s)=\frac{\frac{1}{s}+\frac{1}{s^2}+\frac{1}{1+s^2}+4x(0)+sx(0)+x'(0)}{(s+2)^2}$$
Now, with inverse Laplace transform we find:
$$x(t)=\frac{25t-16\cos(t)+12\sin(t)+e^{-2t}\left(4(4+25x(0))+5t(40x(0)+20x'(0)-1)\right)}{100}$$
A: There are different approaches to finding the particular solution to an ODE. The simplest, and I believe the method you are referring to here, is to use the method of Undetermined Coefficients. This method basically amounts to guessing what the solution may be, given the non-homogeneous functions that appear. For an ODE 
$$\sum_{n = 1}^{m} a_n y^{(n)} = g(x)$$
if $g(x)$ contains 
$ae^{bx}$
for some constants $a, b$, then it is logical to guess that the particular solution should contain an exponential of the form $Ae^{bx}$. Similarly, if we have some sines or cosines, we know to get those our particular solution must have a linear combination of sines and cosines. If we have an $n$ degree polynomial, then we should also guess a linear combination of polynomials. 
This method shouldn't be viewed as some sophisticated or strange procedure, it is a very logical form of guessing. Sometimes this procedure will not work or be sufficient and more sophisticated techniques like Variation of Parameters are needed, which expresses the particular solution in terms of the Wronskian and integrals.
A: Your equation is linear, so you can decompose its solution into three parts. In particular, let $x = u+v+z$, where
$$
\begin{cases}
\ddot{u} + 4\dot{u} + 4u=1\\
\ddot{v} + 4\dot{v} + 4v=t\\
\ddot{z} + 4\dot{z} + 4z=\sin t
\end{cases}
$$
You can easily verify that if $u,v,z$ solve the above equations, then $x=u+v+z$ is a solution to your equation (thanks to linearity). From here, it is easy to find a particular solution for each of the three equations. 
When looking for a particular solution, you are free to find any solution. A good start is with a guess that is "similar" to the right hand side. Hence, you start with $u=A$, $v=Bt$ and $z=C\sin t + D\cos t$, and you try to see if, for a particular choice of the constants, they actually are solutions. Notice that when the right hand side is a sine or cosine, the solution will in general include both.
That said, there is no universal good guess for particular solutions. There are good guesses for linear equations like yours, but one must pay attention to some details. For instance, you cannot use a guess that is also a solution of the corresponding homogeneous equation. But other than that, the rule of thumb is: if the RHS is a polynomial of degree $k$, try a polynomial of degree $k$, if it is a sine/cosine, try a sum of sine and cosine with the same frequency, if it is an exponential $e^{at}$, try a multiple of such exponential. The good guesses become more complicated if you have more complicated right hand sides, but in your case, you have something relatively simple.
