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

## Problem 4.3

### Problem 4.3 Part 2

#### Problem Statement

Given: ${\displaystyle y''-3y'+2y=r(x)\!}$

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

With initial conditions: ${\displaystyle y(-{\frac {3}{4}})=1,y'(-{\frac {3}{4}})=0\!}$

Find the overall solution ${\displaystyle y_{n}(x)\!}$ for ${\displaystyle n=4,7,11\!}$ and plot these solutions on the interval from ${\displaystyle [-{\frac {3}{4}},3]\!}$

#### Solution

First we find the homogeneous solution to the ODE:
The characteristic equation is:
${\displaystyle \lambda ^{2}-3\lambda +2=0\!}$
${\displaystyle (\lambda -2)(\lambda -1)=0\!}$
Then, ${\displaystyle \lambda =1,2\!}$
Therefore the homogeneous solution is:
${\displaystyle y_{h}=C_{1}e^{(}2x)+c_{2}e^{x}\!}$

Now to find the particulate solution
For n=4

${\displaystyle r(x)=\sum _{0}^{n}-{\frac {(-1)^{n}x^{n}}{n\ln(10)}}\!}$

${\displaystyle 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:

${\displaystyle {\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
${\displaystyle y_{p4}=4.0444+3.7458x+1.5743x^{2}+0.3981x^{3}+0.0543x^{4}\!}$

Superposing the homogeneous and particulate solution we get
${\displaystyle y_{n}=4.0444+3.7458x+1.5743x^{2}+0.3981x^{3}+0.0543x^{4}+C_{1}e^{2x}+C_{2}e^{x}\!}$

Differentiating:
${\displaystyle y'_{n}=3.7458+3.1486x+1.1943x^{2}+0.2172x^{3}+2C_{1}e^{2x}+C_{2}e^{x}\!}$ Evaluating at the initial conditions:
${\displaystyle y(-0.75)=0.9698261719+0.231301601C_{!}+0.4723665527C_{2}=1\!}$
${\displaystyle y'(-0.75)=1.9645125+0.4462603203C_{1}+0.4723665527C_{2}\!}$

We obtain:
${\displaystyle C_{1}=-4.46\!}$
${\displaystyle C_{2}=0.055\!}$

Finally we have:
${\displaystyle y_{n}=4.0444+3.7458x+1.5743x^{2}+0.3981x^{3}+0.0543x^{4}-4.46e^{2x}+0.055e^{x}\!}$

For n=7

${\displaystyle r(x)=\sum _{0}^{n}-{\frac {(-1)^{n}x^{n}}{n\ln(10)}}\!}$

${\displaystyle 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:

${\displaystyle {\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
${\displaystyle 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
${\displaystyle 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_{1}e^{(}2x)+c_{2}e^{x}\!}$

Differentiating:
${\displaystyle y'_{n}=375.3933+371.213x+181.644x^{2}+57.9784x^{3}+13.46x^{4}+2.1714x^{5}+0.214x^{6}+2C_{1}e^{(}2x)+C_{2}e^{x}\!}$ Evaluating at the initial conditions:
${\displaystyle y(-0.75)=178.816+0.2231301601C_{!}+0.4723665527C_{2}=1\!}$
${\displaystyle y'(-0.75)=178.413+0.4462603203C_{1}+0.4723665527C_{2}\!}$

We obtain:
${\displaystyle C_{1}=-2.6757\!}$
${\displaystyle C_{2}=-375.173\!}$