Solve the following ODE by using the method of undetermined coefficients in which Euler's formula needs to be utilized:

${y}^{\u2033}-2{y}^{\prime}+y=\mathrm{sin}(t)$

The way that I solved this doesn't involve Euler's formula, and I was wondering how I might use the formula here.

My approach:

The formula can be written as $y(t)={y}_{h}(t)+{y}_{p}(t)$ where ${y}_{h}(t)$ is the "homogeneous version" of the ODE and ${y}_{p}(t)$ is the particular solution that we'll obtain via the basic rule of the method of undetermined coefficients.

${y}_{h}(t)$:

Putting $r(t)=\mathrm{sin}(t)=0$ in the original equation, the ODE we need to solve is:

${y}^{\u2033}-2{y}^{\prime}+y=0$

where we can set the general solution as $y={e}^{\lambda t}$ and obtain the characteristic equation:

${\lambda}^{2}-2\lambda +1=0$

which has a real double root, hence giving us the solution:

${y}_{h}(t)=({c}_{1}+{c}_{2}t){e}^{t}$

${y}_{p}(t)$:

Judging by the fact that $r(t)$ is shape $k\mathrm{sin}(\omega t)$ and we know that $\omega =1$ we can set the general solution to be of form:

$\begin{array}{rl}{y}_{p}(t)& =\phantom{-}K\mathrm{cos}(t)+M\mathrm{sin}(t)\\ {y}_{p}^{\prime}(t)& =-K\mathrm{sin}(t)+M\mathrm{cos}(t)\\ {y}_{p}^{\u2033}(t)& =-K\mathrm{cos}(t)-M\mathrm{sin}(t)\end{array}$

substituting these equations into the original equation and then simplifying gives us:

${y}_{p}(t)=\frac{1}{2}\mathrm{cos}(t)$

And in conclusion, we can write that the solution to the given ODE is:

$\begin{array}{rl}y(t)& ={y}_{h}(t)+{y}_{p}(t)\\ & =({c}_{1}+{c}_{2}t){e}^{t}+\frac{1}{2}\mathrm{cos}(t)\end{array}$

How would we be able to derive this conclusion via Euler's formula? Thanks in advance.

${y}^{\u2033}-2{y}^{\prime}+y=\mathrm{sin}(t)$

The way that I solved this doesn't involve Euler's formula, and I was wondering how I might use the formula here.

My approach:

The formula can be written as $y(t)={y}_{h}(t)+{y}_{p}(t)$ where ${y}_{h}(t)$ is the "homogeneous version" of the ODE and ${y}_{p}(t)$ is the particular solution that we'll obtain via the basic rule of the method of undetermined coefficients.

${y}_{h}(t)$:

Putting $r(t)=\mathrm{sin}(t)=0$ in the original equation, the ODE we need to solve is:

${y}^{\u2033}-2{y}^{\prime}+y=0$

where we can set the general solution as $y={e}^{\lambda t}$ and obtain the characteristic equation:

${\lambda}^{2}-2\lambda +1=0$

which has a real double root, hence giving us the solution:

${y}_{h}(t)=({c}_{1}+{c}_{2}t){e}^{t}$

${y}_{p}(t)$:

Judging by the fact that $r(t)$ is shape $k\mathrm{sin}(\omega t)$ and we know that $\omega =1$ we can set the general solution to be of form:

$\begin{array}{rl}{y}_{p}(t)& =\phantom{-}K\mathrm{cos}(t)+M\mathrm{sin}(t)\\ {y}_{p}^{\prime}(t)& =-K\mathrm{sin}(t)+M\mathrm{cos}(t)\\ {y}_{p}^{\u2033}(t)& =-K\mathrm{cos}(t)-M\mathrm{sin}(t)\end{array}$

substituting these equations into the original equation and then simplifying gives us:

${y}_{p}(t)=\frac{1}{2}\mathrm{cos}(t)$

And in conclusion, we can write that the solution to the given ODE is:

$\begin{array}{rl}y(t)& ={y}_{h}(t)+{y}_{p}(t)\\ & =({c}_{1}+{c}_{2}t){e}^{t}+\frac{1}{2}\mathrm{cos}(t)\end{array}$

How would we be able to derive this conclusion via Euler's formula? Thanks in advance.