User:Egm4313.s12.team11.Suh/R4.2

Problem Statement
Using the particular solution from Table 2.1 on Kreyszig, find the overall solution $$y(x)\!$$, and plot it compared with $$y_{n}(x)\!$$ for n = 3,5,9

$$y''-3y'+2y = r(x)\!$$ $$r(x)=sin(x)\!$$ Initial Conditions: $$y(0)=1\!$$, $$y'(0)=0\!$$

Homogenous Solution
To find $$y_{h}(x)\!$$, $$y''-3y'+2y = r(x)\!$$ $$\lambda^{2}-3\lambda+2=0\!$$ $$(\lambda-2)(\lambda-1)=0\!$$ $$\lambda_{1}=2, \lambda_{2}=1\!$$ $$y_{h}(x)=c_{1}e^{2x}+c_{2}e^{x}\!$$

Particular Solution
To find $$y_{p}(x)\!$$, Using Table 2.1, we find that for $$r(x)=sin(x)\!$$, $$y_{p}=Kcos (\omega x)+Msin (\omega x)\!$$ $$y'_{p}=-Ksin (\omega x)+Mcos (\omega x)\!$$ $$y''_{p}=-Kcos (\omega x)-Msin (\omega x)\!$$

Plugging it back into the equation, $$(-Kcos (x)-Msin (x))-3(-Ksin (x)+Mcos (x))+2(Kcos (x)+Msin (x)) = sin(x)\!$$ $$(3K+M)sin(x)+(K-3M)cos(x) = sin(x)\!$$

Solving for coefficients, $$(3K+M)sin(x) = 1\!$$ $$(K-3M)cos(x) = 0\!$$ $$K=\frac{3}{10}\!$$ $$M=\frac{1}{10}\!$$ $$y_{p}(x)=\frac{3}{10}cos(x)+\frac{1}{10}sin(x)\!$$

Overall Solution
$$y(x)=y_{h}(x)+y_{p}(x)\!$$ $$y(x)=c_{1}e^{2x}+c_{2}e^{x}+\frac{3}{10}cos(x)+\frac{1}{10}sin(x)\!$$

Solving with initial conditions, $$y(x)=c_{1}e^{2x}+c_{2}e^{x}+\frac{3}{10}cos(x)+\frac{1}{10}sin(x)\!$$ $$y'(x)=2c_{1}e^{2x}+c_{2}e^{x}-\frac{3}{10}sin(x)+\frac{1}{10}cos(x)\!$$

$$1=c_{1}+c_{2}+\frac{3}{10}\!$$ $$0=2c_{1}+c_{2}+\frac{1}{10}\!$$ $$c_{1}=\frac{-4}{5}\!$$ $$c_{2}=\frac{3}{2}\!$$

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

Plot
Plotting in matlab yields: As shown on the graph, the two plots are exactly the same.

Created by [| Daniel Suh] 20:57, 7 February 2012 (UTC)