solve the initial value problem ,by Taylor's method of order $N=3$

$\begingroup$

solve the initial value problem ,by Taylor's method of order $N=3$

$y'(t)=ty(t)+(1-t)e^t,0\le t\le 2,y(0)=1$

with an accuracy of $5 \times10^{-3}$

first we consider the taylor expansion of $e^x$

$ e^x=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+....$

for $N=3$ we have

$\large e^x=1+x+\frac{x^2}{2}+\frac{x^3}{6} \\ \large y'=yt+(1-t)(1+t+\frac{t^2}{2}+\frac{t^3}{6}) $

bernoulli equation of the form $y'+py=q\implies y u=\int uq dx,u(x)=e^{\int p }dx$

$ y'+(-t)y=1+t+\frac{t^2}{2}+\frac{t^3}{6}$

$u(t)=e^{\int {-t}}dt=e^{-\frac{t^2}{2}} \\ y(t)e^{-\frac{t^2}{2}}=\int (e^{\frac{t^2}{2}})(1-t)(1+t+\frac{t^2}{2}+\frac{t^3}{6}) dt$

$y(t)= e^{\frac{t^2}{2}}\int(1-t)[ e^{-\frac{t^2}{2}}+t e^{-\frac{t^2}{2}}+\frac{1}{2}t^2e^{-\frac{t^2}{2}}+\frac{1}{6}t^3e^{-\frac{t^2}{2}}]dt\\=e^{\frac{t^2}{2}}\int (e^{-\frac{t^2}{2}}-\frac{1}{2}t^2e^{-\frac{t^2}{2}}-\frac{1}{3}t^3e^{-\frac{t^2}{2}}-\frac{1}{6}t^4e^{-\frac{t^2}{2}})dt$

$=e^{\frac{t^2}{2}}\int (e^{-\frac{t^2}{2}})(1-\frac{1}{2}t^2-\frac{1}{3}t^3-\frac{1}{6}t^4)dt$

$\endgroup$ 8

3 Answers

$\begingroup$

Your question is not clear, so lets use three methods to solve this.

We are given:

$$y'(t)=ty(t)+(1-t)e^t,0\le t\le 2,y(0)=1$$

Method 1 Integrating Factor

We can solve this problem and get a result of:

$$y(t) = e^t$$

Method 2 Taylor Series Method

To solve this using a Taylor series with $N = 3$, we assume a solution of the form:

$$\tag 1 \displaystyle y(t) = \frac{y(0)}{0!} + \frac{y'(0)}{1!}(t-0) + \frac{y''(0)}{2!}(t-0)^2 + \frac{y'''(0)}{3!}(t-0)^3 + \ldots$$

We have:

  • $y'(t) = ty(t)+(1-t)e^t$
  • $y''(t) = y + ty' -te^t$
  • $y'''(t) = y' + y' + ty'' -e^t - te^t$

Now, we evaluate each of these at $t=0$, so we have:

  • $y(0) = 1$
  • $y'(0) = 1$
  • $y''(0) = 1$
  • $y'''(0) = 1$

Substituting these values back into $(1)$ yields:

$$\displaystyle y(t) = 1 + t + \frac{t^2}{2!} + \frac{t^3}{3!} + \ldots$$

What do you recognize this series as?

Method 3 Numerical Solution using Taylor Series

Using a numerical approach for Taylor methods of order $n$ (in our case, $N = 3$), we have:

  • $w_0 = \alpha$
  • $w_{i+1} = w_i + h T^{(n)}(t_i,w_i)$ for each $i = 0, 1, \ldots, N-1$,
  • where $T^{(n)}(t_i,w_i) = f(t_i,w_i) + \dfrac{h}{2}f'(t_i,w_i)+ \ldots + \dfrac{h^{n-1}}{n!}f^{(n-1)}(t_i,w_i)$

Can you now proceed with Method 3 (you have all the needed derivatives for this method from Method 2)?

$\endgroup$ 8 $\begingroup$

Attempt ${2}$

$y'+(-t)y=(1-t)e^t$

$u=e^{\int -tdt}=e^{-\frac{t^2}{2}}$

$\large ye^{\frac{t^2}{2}}=\int e^{-\frac{t^2}{2}}(1-t)e^tdt\implies ye^{-\frac{t^2}{2}}=\int e^{-\frac{t^2}{2}+t}(1-t)=\int e^{\frac{-t^2+2t}{2}}(1-t)dt$

$y e^{\frac{-t^2+2t}{2}} \approx \int(1+\frac{-t^2+2t}{2}+\frac{(\frac{-t^2+2t}{2})^2}{2!}+\frac{(\frac{-t^2+2t}{2})^3}{3!})(1-t)dt$

$let \\ x=\frac{-t^2+2t}{2},dx=(1-t)dt$

$ye^x\approx\int (1+x+\frac{x^2}{2}+\frac{x^3}{6})dx\approx x+\frac{x^2}{2}+\frac{x^3}{6}+\frac{x^4}{24}+c$

$y(0)=1,t=0 \implies x=0\\1(e^0)=0+c,c=1\\y\approx e^{-x}(x+\frac{x^2}{2}+\frac{x^3}{6}+\frac{x^4}{24}+1) $

$\endgroup$ $\begingroup$

In fact you don't need to solve this ODE BY Taylor's method, since this ODE has close-form solution:

$y'=ty+(1−t)e^t$

$y'-ty=(1−t)e^t$

I.F. $=e^{\int-t~dt}=e^{-\frac{t^2}{2}}$

$\therefore\left(e^{-\frac{t^2}{2}}y\right)'=(1−t)e^{t-\frac{t^2}{2}}$

$e^{-\frac{t^2}{2}}y=\int(1−t)e^{t-\frac{t^2}{2}}~dt$

$e^{-\frac{t^2}{2}}y=\int(1−t)e^{-\frac{t^2-2t}{2}}~dt$

$e^{-\frac{t^2}{2}}y=\int(1−t)e^{-\frac{t^2-2t+1-1}{2}}~dt$

$e^{-\frac{t^2}{2}}y=\int(1−t)e^{-\frac{(t-1)^2-1}{2}}~dt$

$e^{-\frac{t^2}{2}}y=e^{-\frac{(t-1)^2-1}{2}}+C$

$e^{-\frac{t^2}{2}}y=C+e^{t-\frac{t^2}{2}}$

$y=Ce^\frac{t^2}{2}+e^t$

$y(0)=1$ :

$C+1=1$

$C=0$

$\therefore y=e^t$

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like