Originally Posted by

**kjey** Hello. I'm having problems with solving a pretty straight forward differential equation by using Euler's method.

Exercise 1: Solve $\displaystyle x' = 1 + x^2$ where $\displaystyle x(0)=1$.

**Answer 1:** This exercise is not the problem (I think). Anyway, the answer is:

$\displaystyle x(t) = \tan{(t+\frac{\pi}{4})}\Rightarrow x' = 1 + (\tan{(t+\frac{\pi}{4})})^2$.

**Exercise 2:** Solve the differential equation numerically on the interval [0,0.6] with Euler's method using 6 steps.

**Answer 2:** I have tried to use $\displaystyle x_n = x_{n-1} + h*(1 + x_{n-1}^2)$ where $\displaystyle h=0.1 \land x_0=1$, but it doesn't make any sense. The "exact" values for x'(t) are

$\displaystyle x'(0.0) = 2, x'(0.1) = 2,4958... , x'(0.2)=3,2755...$ etc.

When I use "my method" the numbers are totally different from them above. Can anyone explain what I do wrong? I must have misunderstand something...