Solve the homogeneous equation
![y'' + 3y' + 2y = 0](https://img.qammunity.org/2023/formulas/mathematics/college/qytemf11b1kdks2d6ngybj0a4hz88sin1o.png)
Its characteristic equation is
![r^2 + 3r + 2 = (r + 1) (r + 2) = 0](https://img.qammunity.org/2023/formulas/mathematics/college/k317sjn9soldtsqa4r56ppfhp8587v4mvh.png)
with roots at
and
, hence the characteristic solution is
![y_c = C_1 e^(-x) + C_2 e^(-2x)](https://img.qammunity.org/2023/formulas/mathematics/college/rr2v2swgbvaali85kn9cy5r0bnaxvwnshz.png)
For the nonhomogeneous equation, I'll use variation of parameters. We're looking for a solution of the form
![y = u_1 y_1 + u_2 y_2](https://img.qammunity.org/2023/formulas/mathematics/college/m51cxtfnym4c1h7v685u6ldnx672fe443y.png)
to the equation
![y'' + a(x) y'' + b(x) y = f(x)](https://img.qammunity.org/2023/formulas/mathematics/college/79ymfai1g4i63ld6yq4b9noldyjr3vxrdl.png)
such that
![\displaystyle u_1 = - \int (y_2f(x))/(W(y_1,y_2)) \, dx](https://img.qammunity.org/2023/formulas/mathematics/college/hl9jf42uonufl3pllnozua468ip7ifufgv.png)
![\displaystyle u_2 = \int (y_1 f(x))/(W(y_1,y_2)) \, dx](https://img.qammunity.org/2023/formulas/mathematics/college/1qdm9yjb118d971ztky41gn553tdho9rbv.png)
The Wronskian
of the two fundamental solutions
and
is
![W(y_1,y_2) = \begin{vmatrix} y_1 & y_2 \\ {y_1}' & {y_2}' \end{vmatrix} = -e^(-3x)](https://img.qammunity.org/2023/formulas/mathematics/college/rbba1rcw6e7wmw3yeo9xhn97ie2g3jjqtc.png)
Then we have
![\displaystyle u_1 = - \int (e^(-2x) \cdot 4e^x \cos(3x))/(-e^(-3x)) \, dx = 4 \int e^(2x) \cos(3x) \, dx](https://img.qammunity.org/2023/formulas/mathematics/college/lhslkeykujui3frpybzjubopi0vrowfch9.png)
![\displaystyle u_2 = \int (e^(-x) \cdot 4e^x \cos(3x))/(-e^(-3x)) \, dx = -4 \int e^(3x) \cos(3x) \, dx](https://img.qammunity.org/2023/formulas/mathematics/college/p4q711th5n6i4e809w6mdfdvc05wu10mp6.png)
Recall Euler's identity,
![e^((a+bi)t) = e^(at) (\cos(bt) + i \sin(bt))](https://img.qammunity.org/2023/formulas/sat/high-school/8qvko9rs2017wgbvnmra19f4w8gnay8anm.png)
Then we have the general antiderivative
![\displaystyle \int e^((a+bi)t) \, dt = \frac1{a+bi} e^((a+bi)t) + C = (a-bi)/(a^2+b^2) e^((a+bi)t) + C](https://img.qammunity.org/2023/formulas/mathematics/college/v1niwb6m7zragmhq3mlwho0xdserdb3phb.png)
Taking the real parts of both sides, we have
![\displaystyle \mathrm{Re}\left\{\int e^((a+bi)t) \, dt \right\} = \mathrm{Re}\left\{(a-bi)/(a^2+b^2) e^((a+bi)t) + C\right\} \\\\ \int\,\mathrm{Re}\left\{e^((a+bi)t)\right\} \, dt = (e^(at))/(a^2+b^2) \mathrm{Re}\left\{(a-bi)(\cos(bt) + i \sin(bt))\right\} + C \\\\ \int e^(at) \cos(bt) \, dt = (e^(at))/(a^2+b^2) (a\cos(bt)+b\sin(bt)) + C](https://img.qammunity.org/2023/formulas/mathematics/college/ys49nk0b1y3w1qn161gw456zx5spfexemq.png)
so that
![\displaystyle u_1 = 4 \int e^(2x) \cos(3x) \, dx = (4e^(2x))/(13) (2\cos(3x) + 3 \sin(3x))](https://img.qammunity.org/2023/formulas/mathematics/college/sfjz19rbql892jgcpwdi41p0oe8jy8ahl4.png)
and
![\displaystyle u_2 = -4 \int e^(3x) \cos(3x) \, dx = -\frac{2e^(3x)}3 (\cos(3x) + \sin(3x))](https://img.qammunity.org/2023/formulas/mathematics/college/hrnapfpdehdbntkvkllalsvq8tlez73q7i.png)
We've found
![y = u_1 y_1 + u_2 y_2](https://img.qammunity.org/2023/formulas/mathematics/college/m51cxtfnym4c1h7v685u6ldnx672fe443y.png)
![\displaystyle y = (4e^x)/(13) (2\cos(3x) + 3 \sin(3x)) - \frac{2e^x}3 (\cos(3x) + \sin(3x))](https://img.qammunity.org/2023/formulas/mathematics/college/pulipnzw2txy4p2qiv9eqllh57102co2rw.png)
![\displaystyle y = \frac2{39} e^x (5\sin(3x) - \cos(3x))](https://img.qammunity.org/2023/formulas/mathematics/college/wpsd82h8h03kyfr7xz7ooukt67aks726dp.png)
Then the general solution to the differential equation is
![\boxed{y(x) = C_1 e^(-x) + C_2 e^(-2x) + \frac2{39} e^x (5\sin(3x) - \cos(3x))}](https://img.qammunity.org/2023/formulas/mathematics/college/wi7y9guu6tbcicwqt3vft7b9fyferb7oro.png)