User:Egm4313.s12.team8.kyle/R5.6

Problem Statement
Find the solution $$ y(x) $$ to the problem given the following:

$$ y''+4y'+13y=2e^{-2x} \cos(3x) $$

$$ y_h(x)=(e^{-2x})(A\cos(3x)+B\sin(3x))$$

$$ y_{p}(x)=x(e^{-2x})(M\cos(3x)+N\sin(3x)) $$

$$ y(0)=1, \, y'(0)=0 $$

Solution
First determine the first and second derivatives of the particular solution $$ y_p(x)$$:

$$ y'_{p}(x)=\frac{d}{dx}\frac{(x (M \cos(3 x)+N \sin(3 x))}{e^{2 x}} = e^{-2 x} (\sin(3 x) (-3 M x-2 N x+N)+\cos(3 x) (-2 M x+M+3 N x)) $$

$$ y''_{p}(x)=\frac{d^2}{dx^2}\frac{(x (M \cos(3 x)+N \sin(3 x))}{e^{2 x}} = e^{-2 x} (\sin(3 x) (6 M (2 x-1)-N (5 x+4))-\cos(3 x) (M (5 x+4)+6 N (2 x-1))) $$

Inserting these derivatives into the original ODE yields:

$$ e^{-2 x} (\sin(3 x) (6 M (2 x-1)-N (5 x+4))-\cos(3 x) (M (5 x+4)+6 N (2 x-1)))+4(e^{-2 x} (\sin(3 x) (-3 M x-2 N x+N)+\cos(3 x) (-2 M x+M+3 N x)))+13(x(e^{-2x})(M\cos(3x)+N\sin(3x)))=2e^{-2x} $$

Cancel like terms leads to the following variables:

$$ M=0 $$

$$ N=\frac{1}{3} $$

Given that $$ y(x)= y_{h}(x)+y_{p}(x)$$ insert the homogeneous and particular solutions with the calculated M and N to express $$y(x)$$:

$$ y(x)=(e^{-2x})(A\cos(3x)+B\sin(3x))+x(e^{-2x})((0)\cos(3x)+(1/3)\sin(3x)) $$

simplifying to:

$$ y(x)=(e^{-2x})(A\cos(3x)+B\sin(3x))+x(e^{-2x})((1/3)\sin(3x)) $$

Using the first initial condition $$ y(0)=1 $$ simplifies the equation further to:

$$y(0)=(e^{0})(A\cos(0)+B\sin(0))+0(e^{0})((1/3)\sin(0))=A=0$$

Showing that: $$ A=0 $$

To use the second initial condition $$ y'(0)=0 $$ first calculate y' knowing that $$A=0$$:

$$ y' = (1/3) e^{-2 x} (3 (3 B+x-2) \cos(3 x)-2 (3 B+x+4) \sin(3 x))=0 $$

Solving for B yields:

$$ B=\frac{5}{3} $$

Now with all variables $$M, N, A, B$$ solved, $$y(x)$$ can be expressed:

$$ y(x)=(e^{-2x})(cos(3x)+(\frac{5}{3})sin(3x))+x(e^{-2x})((1/3)\sin(3x)) $$

The following plot illustrates the the solutions behavior over 3 periods: