# Use Euler's method with h=0.1 to find approximate values?

1. Dec 5, 2014

### Math10

1. The problem statement, all variables and given/known data
Use Euler's method with h=0.1 to find approximate values of the solution of the initial-value problem y'+3y=7e^(4x), y(0)=2 at x=0, 0.1, 0.2, 0.3, ..., 1.0.

2. Relevant equations
f(x, y)=7e^(4x)-3y
x0=0, y0=2

3. The attempt at a solution
y(0.1)=y1=y0+f(0, 2)(0.1)=2+(0,1)f(0, 2)=2.1
y(0.2)=y2=y1+f(0.1, 2.1)(0.1)=2.1+(0.1)f(0.1, 2.1)=2.51428
And so on...
But am I doing it right? If not, then please correct me.

2. Dec 5, 2014

### Joffan

Looks good so far.

You could use a table format like this to show the rest of your results:

$$\begin{array}{|c|c|c|c|c|c|c|} \hline \text{Step }n & y_n & x_n & f(x_n,y_n) & h & \Delta y & y_{n+1} \\ \hline 0 & 2 & 0 & 1 & 0.1 & 0.1 & 2.1 \\ \hline 1 & 2.1 & 0.1 & 4.1428 & 0.1 & 0.41428 & 2.51428 \\ \hline 2 & 2.51428 & 0.2 & ?? & 0.1 & ?????? & ??????? \\ \hline 3 & ??????? & 0.3 & ?? & 0.1 & ?????? & ??????? \\ \hline 4 & ??????? & 0.4 & ?? & 0.1 & ?????? & ??????? \\ \hline 5 & ??????? & 0.5 & ?? & 0.1 & ?????? & ??????? \\ \hline 6 & ??????? & 0.6 & ?? & 0.1 & ?????? & ??????? \\ \hline 7 & ??????? & 0.7 & ?? & 0.1 & ?????? & ??????? \\ \hline 8 & ??????? & 0.8 & ?? & 0.1 & ?????? & ??????? \\ \hline 9 & ??????? & 0.9 & ?? & 0.1 & ?????? & ??????? \\ \hline \end{array}$$

3. Dec 5, 2014

### Math10

Do I nee to solve for y(1)? Because it says x=0, 0.1, 0.2, 0.3, ..., 1.0.

4. Dec 5, 2014

### Staff: Mentor

Yes. I don't know why you would think you don't need to.

y(1) means the y value when x = 1.0.

5. Dec 5, 2014

### Staff: Mentor

PF now supports various table bbcode tags, an alternative to using LaTeX. Here are the header row and two rows of the first three columns of the table above.
[TABLE]
[TR][TH]Step (n)[/TH][TH]yn[/TH] [TH]xn[/TH][/TR]
[TR][TD1]0[/TD1][TD1]2[/TD1] [TD1]0[/TD1] [/TR]
[TR][TD1]1[/TD1][TD1]2.1[/TD1] [TD1]0.1[/TD1] [/TR]
[/TABLE]

6. Dec 5, 2014

### Math10

So the answer starts with y1 to y10, right?

7. Dec 5, 2014

### Joffan

Those are the numbers requested. Note that in the table I gave you, y10 is in the bottom right corner - this is our Euler-method estimate of y(1.0)

Thanks... not sure which I prefer really, but the compact output is good.

Last edited: Dec 5, 2014
8. Dec 5, 2014

### Staff: Mentor

I don't which I like better either. It's pretty much six of one, half a dozen of the other.

9. Dec 6, 2014