Given:
![{\displaystyle y''-3y'+2y=r(x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/01a25cd23b4aa2ccd2e7e13e69b98c297b3c0462)
where ![{\displaystyle r(x)=\log(1+x)\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ad9349835503f60351e194f5fd32928c82452aae)
With initial conditions: ![{\displaystyle y(-{\frac {3}{4}})=1,y'(-{\frac {3}{4}})=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c36e28286d992c531ca68f8ff03a2caaa09a63db)
Find the overall solution
for
and plot these solutions on the interval from
First we find the homogeneous solution to the ODE:
The characteristic equation is:
![{\displaystyle (\lambda -2)(\lambda -1)=0\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/af5d3775e3da754de856d4bda6f0a85f8b327555)
Then,
![{\displaystyle \lambda =1,2\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/665b8a8e6b8fcd57dc28291fa259644ff6ba659a)
Therefore the homogeneous solution is:
![{\displaystyle y_{h}=C_{1}e^{(}2x)+c_{2}e^{x}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/0903940be1db8899b50568a3a9924c71b73d2481)
Now to find the particulate solution
For n=4
![{\displaystyle r(x)=\sum _{0}^{n}-{\frac {(-1)^{n}x^{n}}{n\ln(10)}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/1995083561ffc8842cfab6eef6aba7e3e9281a5c)
![{\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)}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7bdf452f7b56fad218572d2e7f0760dabbabbece)
We can then use a matrix to organize the known coefficients:
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}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/a89d48a5e2943c12c7ff84b38b557bd611bab7de)
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}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/9f28bf5ba855dac54eb8f80cd3039ab09cbb742d)
Differentiating:
Evaluating at the initial conditions:
![{\displaystyle y(-0.75)=0.9698261719+0.231301601C_{!}+0.4723665527C_{2}=1\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/5e32e527292d31e950f9235e32fed6d2ed806f67)
![{\displaystyle y'(-0.75)=1.9645125+0.4462603203C_{1}+0.4723665527C_{2}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/13c8b8c57d716e1b520ddeb0096e10898e497a0b)
We obtain:
![{\displaystyle C_{1}=-4.46\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/aedbb96c22531f7d5bfad39b43a6e3d57b694c20)
![{\displaystyle C_{2}=0.055\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f1b952e8e3f092bf1a8f336333a1f79661218cec)
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}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8dbfda5a566057849a420cc69b0500d5109c61bc)
For n=7
![{\displaystyle r(x)=\sum _{0}^{n}-{\frac {(-1)^{n}x^{n}}{n\ln(10)}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/1995083561ffc8842cfab6eef6aba7e3e9281a5c)
![{\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)}}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/774b6448372b67eb6693c68f962062e1f27ba82e)
We can then use a matrix to organize the known coefficients:
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}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/0db9b140684a1139aa91da23c7819c56ce9cf06a)
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}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/0c011d30adec66b8ff709a1f53ea1f6ea06270a1)
Differentiating:
Evaluating at the initial conditions:
![{\displaystyle y(-0.75)=178.816+0.2231301601C_{!}+0.4723665527C_{2}=1\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8bd60f405c19cb1867ad39fea28fcae0340f7277)
![{\displaystyle y'(-0.75)=178.413+0.4462603203C_{1}+0.4723665527C_{2}\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/a809fa359950e34c98c6ffd76ed67fbe95979e91)
We obtain:
![{\displaystyle C_{1}=-2.6757\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/83757e6fc287a997666578f9a5f5e82e2827ae64)
![{\displaystyle C_{2}=-375.173\!}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8a44af748b654cb29dbd44c423dbfd08a02acb5d)