TITLE: Use Euler's method to approximate $\int^2_0 e^{-u^2}du$
QUESTION [5 upvotes]: We learned Euler's method today there is one hw problem totally stunned my hat off. It says:
Use Euler's method to approximate $\int^2_0 e^{-u^2}du$. I know Euler's method is $y_{n+1} = y_n + hf(t_n,y_n)$, but this is for $y'$ right? somehow I can compute an integral? This is supposed to be done using computer, I know how to use Euler's method to solve equation like $y' = 2y - 3e^{-t}$.
Thanks for viewing!

REPLY [6 votes]: Let $y(t) = \int_0^t e^{-u^2} du$. By the fundamental theorem of calculus, $y$ satisfies the differential equation
$y' = e^{-t^2}$.
You are trying to approximate $y(2)$. So it is the sort of problem you know how to solve.

REPLY [3 votes]: Try to solve this system:
$$y'=e^{-x^2}$$
Start at point 0 and march towards 2.