University of Florida/Egm4313/s12 Report 4, Problem 4.3

Problem Statement
Given: $$y''-3y'+2y=r(x)\!$$

where $$r(x)=\log (1+x)\!$$

With initial conditions: $$ y(-\frac{3}{4}) = 1, y'(-\frac{3}{4}) = 0 \!$$ Find the overall solution $$ y_{n}(x) \!$$ for $$ n = 4,7,11 \!$$ and plot these solutions on the interval from $$ [-\frac{3}{4},3] \!$$

Solution
First we find the homogeneous solution to the ODE: The characteristic equation is: $$\lambda^2-3\lambda+2=0\!$$ $$(\lambda-2)(\lambda-1)=0\!$$ Then, $$\lambda=1,2\!$$ Therefore the homogeneous solution is: $$y_h=C_1e^(2x)+c_2e^x\!$$

Now to find the particulate solution For n=4

$$ r(x)=\sum_{0}^{n}-\frac{(-1)^nx^n}{n\ln (10)} \!$$

$$ r(x)=\frac{x}{\ln(10)}-\frac{x^2}{2\ln(10)}+\frac{x^3}{3\ln(10)}-\frac{x^4}{4\ln(10)} \!$$

We can then use a matrix to organize the known coefficients:

$$ \begin{bmatrix} 2 &-3  &2  &0  & 0\\  0&  2  &-6  &6  & 0\\  0&  0&  2  &-9  &12  \\  0&  0&  0&  2  &-12\\  0&  0&  0& 0 &  2  \\   \end{bmatrix} \begin{bmatrix} K_{0} \\ K_{1} \\ K_{2} \\ K_{3} \\ K_{4} \end{bmatrix} = \begin{bmatrix} 0 \\ \frac{1}{ln(10)} \\ \frac{1}{2ln(10)} \\ \frac{1}{3ln(10)} \\ \frac{1}{4ln(10)} \end{bmatrix}\!$$ Then, using MATLAB and the backlash operator we can solve for these unknowns: Therefore $$ y_{p4}=4.0444+3.7458x+1.5743x^2+0.3981x^3+0.0543x^4 \!$$ Superposing the homogeneous and particulate solution we get $$ y_{n}=4.0444+3.7458x+1.5743x^2+0.3981x^3+0.0543x^4+C_1e^{2x}+C_2e^{x} \!$$ Differentiating: $$y'_{n}=3.7458+3.1486x+1.1943x^2+0.2172x^3+2C_1e^{2x}+C_2e^{x}\!$$ Evaluating at the initial conditions: $$y(-0.75)=0.9698261719+0.231301601C_!+0.4723665527C_2=1\!$$ $$y'(-0.75)=1.9645125+0.4462603203C_1+0.4723665527C_2\!$$ We obtain: $$ C_1=-4.46\!$$ $$ C_2=0.055 \!$$ Finally we have: $$ y_{n}=4.0444+3.7458x+1.5743x^2+0.3981x^3+0.0543x^4-4.46e^{2x}+0.055e^{x} \!$$

For n=7

$$ r(x)=\sum_{0}^{n}-\frac{(-1)^nx^n}{n\ln (10)} \!$$

$$ r(x)=\frac{x}{\ln(10)}-\frac{x^2}{2\ln(10)}+\frac{x^3}{3\ln(10)}-\frac{x^4}{4\ln(10)}+\frac{x^5}{5\ln(10)}-\frac{x^6}{6\ln(10)}+\frac{x^7}{7\ln(10)} \!$$

We can then use a matrix to organize the known coefficients:

$$ \begin{bmatrix} 2 &-3  &2  &0  & 0 &0 &0 &0\\  0&  2  &-6  &6  & 0 &0 &0 &0\\  0&  0&  2  &-9  &12  &0 &0 &0\\  0&  0&  0&  2  &-12 &20 &0 &0 \\  0&  0&  0& 0 &  2 &-15 &30 &0\\ 0 &0 &0 &0 &0 &2 &-18 &42\\ 0 &0 &0 &0 &0 &0  &2 &-21\\ 0 &0 &0 &0 &0 &0 &0 &2\\    \end{bmatrix} \begin{bmatrix} K_{0} \\ K_{1} \\ K_{2} \\ K_{3} \\ K_{4} \\ K_{5} \\ K_{6} \\ K_{7} \end{bmatrix} = \begin{bmatrix} 0 \\ \frac{1}{ln(10)} \\ \frac{1}{2ln(10)} \\ \frac{1}{3ln(10)} \\ \frac{1}{4ln(10)} \\ \frac{1}{5ln(10)} \\ \frac{1}{6ln(10)} \\ \frac{1}{7ln(10)} \end{bmatrix}\!$$ Then, using MATLAB and the backlash operator we can solve for these unknowns: Therefore $$ y_{p7}=377.4833+375.3933x+185.6066x^2+60.5479x^3+14.4946x^4+2.6492x^5+0.3619x^6+0.0310x^7 \!$$ Superposing the homogeneous and particulate solution we get $$ y_{n}=377.4833+375.3933x+185.6066x^2+60.5479x^3+14.4946x^4+2.6492x^5+0.3619x^6+0.0310x^7+C_1e^(2x)+c_2e^x \!$$ Differentiating: $$y'_{n}=375.3933+371.213x+181.644x^2+57.9784x^3+13.46x^4+2.1714x^5+0.214x^6+2C_1e^(2x)+C_2e^x\!$$ Evaluating at the initial conditions: $$y(-0.75)=178.816+0.2231301601C_!+0.4723665527C_2=1\!$$ $$y'(-0.75)=178.413+0.4462603203C_1+0.4723665527C_2\!$$ We obtain: $$ C_1=-2.6757\!$$ $$ C_2=-375.173 \!$$