I have this initial problem: $$ \left\{ \begin{array}{ll} y' = \sin \pi t - 5.55 y & x \in (0,2),\\ y(0) = 0.\\ \end{array} \right. $$
I have calculated solutions using Euler's indirect method. Now I need to calculate the error based on my solution and the exact solution. $$ y(t) = \frac{\pi e^{-5.55t} - \pi\cos\pi t + 5.55 \sin\pi t}{\pi^2 + 5.55^2} $$ My professor gave us such a formula but after the calculations it turns out to be wrong. The professors said it could be so. I have no idea how the formula for solving the exact differential equation will solve. Please help. When using $\cos(\pi)t$ my errors looks good (rise) but $y(0) \neq 0$. When using $\cos(\pi t)$ my $y(0) = 0$ but errors are are in positive and negative changes with almost same value.
Frankly, the problem, as you write it, makes no sense! The equation, $y'= sin(\pi t)- 5.55y$, has independent variable t but then you assert that x lies between 0 and 2. I will assume, you mean $t\in (0, 2)$.
That's a linear equation with constant coefficients. Its associated homogeneous equation is y'= dy/dT= -5.55y. dy/y= -5.55 Dt. Integrating, $ln(y)= -5.55t+ C$ and taking the exponential of both sides, $y= C'e^{-5.55t}$.
To get a solution to the entire equation, try a solution of the form $y= A sin(\pi t)+ B cos(\pi t)$. Then $y'= A\pi cos(\pi t)- B\pi sin(\pi t)$ so the equation becomes $A\pi cos(\pi t)- B\pi sin(\pi t)= sin(\pi t)- 5.55A sin(\pi t)- 5.55B cos(\pi t)$ so $(A\pi+ 5.55B)cos(\pi t)+ (-B\pi+ 5.55A- 1) sin(\pi t)= 0$.
Since this is to be true for all t, we must have $A\pi+ 5.55B= 0$ and $-B\pi+ 5.55A= 1$. From the first equation, $A= \frac{-5.55B}{\pi}$ so the second equation becomes $-B\pi- \frac{5.55^2B}{\pi}= 1$. Solve that for B and then A.