WOLFRAM NOTEBOOK

WOLFRAM|DEMONSTRATIONS PROJECT

Graphic Solution of a First-Order Differential Equation

f
1
initial values
x
1
0.1
y
1
0.3
step
h
0.2
number of points
n
3
show 'exact' solution
show explanation
1
2
3
x
0.1
0.3
0.5
y
0.3
0.42
0.588
y
0.6
0.84
0
This Demonstration presents Euler's method for the approximate (or graphics) solution of a first-order differential equation with initial condition
y'=f(x,y)
,
y(
x
1
)=
y
1
.
The method consists of calculating the approximation of
y(x)
by
x
i+1
=
x
i
+h
,
y
i+1
=
y
i
+hy'(
x
i
)=
y
i
+hf(
x
i
,
y
i
)
,
where
i=1,,n-1
.
These coordinates determine points
P
1
,
P
2
, ,
P
n
. These points form Euler's polygonal line that is an approximate solution of the problem. The Demonstration compares it with a better solution provided by Mathematica's built-in NDSolve function (brown line).
Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.