Numerical Integration and Differentiation
Finite Divided Difference
First order derivatives:
The rst forward nite divided difference
Using Taylor series,
f (xi+1 ) = f (xi ) + f (xi )h +
f (xi ) 2
h + O(h3 )
2!
where h = xi+1 xi . Then f (xi ) can be fou
where f (x, y) is found using the chain-rule as
f (x, y) =
f (x, y) f (x, y) dy
+
x
y dx
Using this method, the approximate local truncation error is
Ea =
where
1
1
f (xi , yi )h3 = f (xi , yi )h3
3!
6
f (x, y) f (x, y) dy
f (x, y) =
+
x
y
dx
f (x, y)
Figure 2: Graphical depiction of the trapezoidal rule
from a = 0 to b = 2.
Solution: f (0) = 0.2, and f (2) = 62.2.
I = (b a)
f (b) f (a)
0.2 + 62.2
= (2 0)
= 62.4
2
2
The true solution is
2
0
f (x)dx = (0.2x + 12.5x2 + x3 )|2 = (0.2 2 + 12.5 22 + 23 ) 0
Ordinary Differential Equations (ODEs)
Runge-Kutta Methods
In this chapter, we study how to solve ordinary differential equations of the form
dy
= f (x, y)
dx
(1)
yi+1 = yi + h
(2)
The method is
where yi is the function value at xi , and yi+1 is the funct
MATH 261 Final (with answers)
Winter 2004
Please note that you are not allowed to use a calculator or any notes. 1. (10 points) Solve the initial value problem (2x2 + y)dx + (x2 y x)dy = 0 with y(1) = 2.
Answer: An integrating factor (function of x only)
MATH 261: Differential Equations Assignment #2 - Solutions for written part
Prob 5: (1 point) Consider the initial value problem dy = y + 2x - x2 , dx with y(0) = 0.
Use the method of successive approximations (iteration of Picard and Lindelof), starting
MATH 261: Dierential Equations MIDTERM with solutions
May 14, 2004
Please note that you are NOT allowed to use a calculator or any notes. 1. (10 points) Solve the initial value problem x dy 3 + 2y = xex , dx with y(1) = 1.
Soln: Dividing by x we get the e
Final Examination
May 27, 2004
MATH-261
1. (10 points) Solve the initial value problem dy = 0, with y(0) = 1. dx You dont need to write the solution in explicit form (i.e. y(x)=.). y sin(x) + (y + 1) cos(x) + y 2
Soln: The equation is in the form of an ex