User:Egm4313.s12.team8.lucas/R3.8

Problem Statement
Find a real, general solution to each L2-ODE-CC.

Number 5) $$\ y''+4y'+4y=e^{-x}cosx$$

Number 6) $$\ y''+y'+(\pi^2+\frac{1}{4})y=e^{-x/2}sin(\pi x)$$

Number 6
$$\ y''+y'+(\pi^2+\frac{1}{4})y=e^{-x/2}sin(\pi x)$$

To find the homogeneous solution, we set r(x)=0:

$$\ y''+y'+(\pi^2+\frac{1}{4})=0$$

$$\ \lambda^2+\lambda+(\pi^2+\frac{1}{4})=0$$

$$\ \lambda=\frac{-b \pm \sqrt{b^2-4ac}}{2a}$$

$$\ \lambda=\frac{-1 \pm \sqrt{1-4(\pi^2+\frac{1}{4})}}{2}$$

$$\ \lambda=\frac{-1 \pm \sqrt{-4\pi^2}}{2}$$

$$\ \lambda=-\frac{1}{2} \pm 2\pi i=\alpha +\omega i => \alpha=-\frac{1}{2},  \omega =2\pi $$

The homogeneous solution with complex roots will take the form:

$$\ y_{h}(x)=e^{\alpha x}(Acos\omega x+Bsin\omega x)$$

By substituting alpha and omega, we get the homogenous solution:

$$\ y_{h}(x)=e^{-x/2}(Acos2\pi x+Bsin2\pi x)$$

The form of the particular solution is based on r(x):

$$\ r(x)=e^{-x/2}sin(\pi x)$$

$$\ y_{p}(x)=e^{-x/2}(K sin \pi x+ M cos \pi x)$$

Differentiating this gives:

$$\ y'_{p}(x)=-\frac{1}{2}e^{-x/2}(Ksin \pi x+M cos \pi x)+e^{-x/2}(-M\pi sin \pi x+ K\pi cos \pi x)$$

Differentitaing again gives:

$$\ y''_{p}(x)=\frac{1}{4}e^{-x/2}(Ksin \pi x+M cos \pi x)-\frac{1}{2}e^{-x/2}(-M\pi sin \pi x+K\pi cos \pi x)-\frac{1}{2}e^{-x/2}(-M\pi sin \pi x+ K\pi cos \pi x)+e^{-x/2}(-K\pi^{2} sin \pi x-M\pi^{2} cos \pi x)$$

Cancelling like terms gives:

$$\ y''_{p}(x)=e^{-x/2}sin \pi x(-\frac{K}{4}+\pi M-\pi^{2}K)+(^{-x/2}cos \pi x(-\frac{M}{4}-\pi K-\pi^{2} M)$$

Then, we substitute $$\ y_{p}(x)$$, $$\ y'_{p}(x)$$, $$\ y''_{p}(x)$$ into the original ODE:

$$\ y''+y'+(\pi^2+\frac{1}{4})y=e^{-x/2}sin(\pi x)$$

$$\ [e^{-x/2}sin \pi x(-\frac{K}{4}+\pi M-\pi^{2}K)+e^{-x/2}cos \pi x(-\frac{M}{4}-\pi K-\pi^{2} M)]+[-\frac{1}{2}e^{-x/2}(Ksin \pi x+M cos \pi x)+e^{-x/2}(-M\pi sin \pi x+ K\pi cos \pi x)]+[(\pi^2+\frac{1}{4})e^{-x/2}(K sin \pi x+ M cos \pi x)]=e^{-x/2}sin(\pi x)$$

$$\ (-\frac{K}{2})e^{-x/2}sin \pi x+(-\frac{M}{2})e^{-x/2}cos \pi x=e^{-x/2}sin(\pi x)$$

Equating like terms gives:

$$\ (-\frac{K}{2})e^{-x/2}sin \pi x=e^{-x/2}sin(\pi x)  =>   K=-2$$

$$\ (-\frac{M}{2})e^{-x/2}cos \pi x=0  =>   M=0$$

Substituting K and M into the general form of the particular solution gives:

$$\ y_{p}(x)=-2e^{-x/2} sin \pi x$$

To find the final solution to the ODE, we add the homogeneous and particular solutions:

$$\ y(x)=y_{h}(x)+y_{p}(x)$$

$$\ y(x)=e^{-x/2}(Acos2\pi x+Bsin2\pi x)-2e^{-x/2} sin \pi x$$