Consider a differencial equation of the form
![{\displaystyle y''+p(t)y'+q(t)y=g(t)}](https://wikimedia.org/api/rest_v1/media/math/render/svg/56075c9a9be684d68a3da391e2ff8d7e4da4e1da)
Clerarly, this is not homogeneous, as
.
So, to solve this, we first proceeed as normal, but assume that the equation is homogeneous; set
for now.
Then the first part of the solution pans like
![{\displaystyle y(t)=c_{1}e^{r_{1}t}+c_{2}e^{r_{2}t}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/430a1743a2e1c9bef94f766486010ec28e7180e3)
.
Now we need to find the particular integral. To do this, make an appropriate substitution that relates to what
is. For instance, if
, then take substitution
.
As
and
are multiples of
in this case, you'll simply get a linear equation in
. Then just plug the value of
in the equation.
Hence the solution is
y = general solution + particular integral.
There is one important caveat which you should be aware though. In the previous example for instance, if the general solution already had
, the substitution cannot be
, as the particular integral cannot be equal to the general solution. In such cases, you need to take the substitution as
.
Solve the differential equation
![{\displaystyle {\frac {d^{2}y}{dx^{2}}}+{\frac {2dy}{dx}}+2y=4+e^{-2x}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/551e25f396a0dff342c41ab9bf5ae2772cb18586)
Given that
![{\displaystyle y(0)=4,y'(0)=-1}](https://wikimedia.org/api/rest_v1/media/math/render/svg/98e66933de244960d713c845d21637ae8d74ce5d)
Take
. Then
![{\displaystyle (d^{2}y)/(dx^{2})+2dy/dx+2y\rightarrow (m+1)^{2}+1=0\rightarrow m+1=\pm i\rightarrow m=-1\pm i}](https://wikimedia.org/api/rest_v1/media/math/render/svg/959efa6cd5d8894cef00243bc223c8cc69a63d1c)
Hence the general form of the equation becomes
![{\displaystyle y=e^{-x}\left(P\cos {x}+Q\sin {x}\right)}](https://wikimedia.org/api/rest_v1/media/math/render/svg/afb759f1140e8a0326818857bdcb7aeae916ab31)
Now, the particular integral has to be found. To do so, we consider RHS:
![{\displaystyle 4+{2e}^{-2x}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/19ef62fe0f0555f9aee119a43309ef016e101988)
. The substation then becomes
![{\displaystyle A+Be^{-2x}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7667da15409b3984b758811070abdfe8ad7dda02)
. Then
![{\displaystyle y^{\prime }=-2Be^{-2x}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/942257c0fafff71791628cc036304b5bbf09491a)
and
![{\displaystyle y^{\prime \prime }=4Be^{-2x}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/e6abd0f2a31eed217bdf2c79351c3f11dd2d0759)
. Then the equation reduces to
![{\displaystyle 4B-4B+2\left(A+Be^{-2x}\right)=4+2e^{-2x}\rightarrow 2A+2Be^{-2x}=4+2e^{-2x}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/70647697b11b130d7ff53347fcd02fedf36dbf83)
. Hence
![{\displaystyle A=2,B=1}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b4c4d41426b4a17834a24f442ddc5d22687d1322)
. The equation is now
![{\displaystyle y=e^{-x}\left(P\cos {x}+Q\sin {x}\right)+2+e^{-2x}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/0d21703a210204b22ea9688aa456c83134e792f3)
Then ![{\displaystyle 4=P+2+1\rightarrow P=1.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ed02587cb48421010b532d3be9b1cb1293307b85)
. Then
![{\displaystyle -e^{-x}\left(P\cos {x}+Q\sin {x}\right)+e^{-x}\left(Q\cos {x}-P\sin {x}\right)-2e^{-2x}=-1=>\ Q-P-2=-1\rightarrow Q-P=1\rightarrow Q=2.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7492d91d98194d01d48ee78a46a2445af5cc1b41)
Hence the final equation is
![{\displaystyle y=e^{-x}\left(\cos {x}+2\sin {x}\right)+2+e^{-2x}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/4d7d1d88be1e5da5aa7c113e3db50ffedcd7c312)