REVISED: Thursday, February 8, 2024
Haskell and Limits. (Note: This blog is a work in progress.)
The word Calculus comes from Latin meaning "small stone". Integral Calculus joins in other words integrates all of the small pieces together to determine the total.
Differential Calculus and Integral Calculus are like inverses of each other, just like multiplication and division are inverses.
I. LIMIT LAWS
Given:
The lim x→a is a special way of saying, ignoring what happens when the value x gets to the value a as the value x moves closer and closer to the value of a the value x becomes a closer and closer approximation of the value of a
A limit is a value that a function approaches as the input x approaches some value.
As shown below, as x approaches a x→a then f(x) approaches L; and as x approaches a x→a then g(x) approaches M.
lim x→a f(x) = L,
lim x→a g(x) = M,
k is some constant,
and n is a positive integer.
A. CONSTANT LAW
lim x→a k f(x) = k (lim x→a f(x)) = k L.
The limit of a constant is that constant provided that limit exists.
B. SUM LAW
lim x→a (f(x) + g(x)) = lim x→a f(x) + lim x→a g(x) = L + M.
The limit of the sums is the sum of the limits provided those limits exist.
C. PRODUCT LAW
lim x→a (f(x) g(x)) = lim x→a f(x) · lim x→a g(x) = L M.
The limit of the products is the product of the limits provided those limits exist.
D. QUOTIENT LAW
lim x→a (f(x) / g(x)) = (lim x→a f(x))/(lim x→a g(x)) = L / M,
if M /= 0.
The limit of the quotients is the quotient of the limits provided those limits exist and the denominator is nonzero.
E. POWER LAW
lim x→a f(x)n = (lim x→a f(x))n = Ln.
F. ROOT LAW
lim x→a n√f(x) = n√lim x→a f(x) = n√L provided if n is even, then f(x) ≥ 0 near a.
G. COMPOSITION LAW
If lim x→a g(x) = M and lim x→M f(x) = f(M), then lim x→a f(g(x)) = f(M).
II. LIMIT DEFINITIONS
A. OFFICIAL LIMIT DEFINITION
ε is epsilon the lower case of the fifth letter of the Greek alphabet.
δ is delta the lower case of the fourth letter of the Greek alphabet.
lim x→a f(x) = L means
for all ε > 0,
there is δ > 0,
so that if x /= a and x is within δ of a ( δ is measuring how close x is to a )
then f(x) is within ε of L ( ε is measuring how close f(x) is to L )
If no such value of L can be found, then we say that the lim x→a f(x) does not exist (DNE).
B. ONE-SIDED LIMIT DEFINITION
We say that the limit of f(x) as x goes to a from the left is L,
lim x→a− f(x) = L
if for every ε > 0 there is a δ > 0 so that whenever x < a and
a − δ < x we have |f(x) − L| < ε.
We say that the limit of f(x) as x goes to a from the right is L,
lim x→a+ f(x) = L
if for every ε > 0 there is a δ > 0 so that whenever x > a and
x < a + δ we have |f(x) − L| < ε.
lim x→a− f(x) = L
if for every ε > 0 there is a δ > 0 so that whenever x < a and
a − δ < x we have |f(x) − L| < ε.
We say that the limit of f(x) as x goes to a from the right is L,
lim x→a+ f(x) = L
if for every ε > 0 there is a δ > 0 so that whenever x > a and
x < a + δ we have |f(x) − L| < ε.
III. USEFUL HASKELL TRIGONOMETRIC FUNCTIONS
Remember Calculus is computed using radians not degrees.
To convert degrees into radians multiply the degrees by pi/180o.
For example, using Haskell 200o converted into radians equals 3.490658503988659 radians as shown using the function below.
f x = x * pi / 180
Some useful built in Haskell Trigonometric functions are as follows:
sin
cos
tan
asin
atan
acos
sinh
tanh
cosh
asinh
atanh
acosh
IV. HASKELL LIMIT EXAMPLES
A. CONSTANT LAW
B. SUM LAW
C. PRODUCT LAW
D. QUOTIENT LAW
E. POWER LAW
F. ROOT LAW
G. COMPOSITION LAW
V. HASKELL LIMIT THEOREMS
A. INTERMEDIATE VALUE THEOREM
If f(x) is a continuous function for all x in the closed interval [a,b] and d is in between f(a) and f(b), then there is a number c in [a,b] such that f(c) = d.
B. SQUEEZE THEOREM
Suppose that g(x) ≤ f(x) ≤ h(x) for all x close to a but not necessarily equal to a. If
lim x→a g(x) = L = lim x→a h(x),
then lim x→a f(x) = L.
lim x→a g(x) = L = lim x→a h(x),
then lim x→a f(x) = L.
VI. CONCLUSION
In this tutorial, you have been introduced to using Haskell to solve integral calculus limit equations.
VII. REFERENCES
Bird, R. (2015). Thinking Functionally with Haskell. Cambridge, England: Cambridge University Press.
Davie, A. (1992). Introduction to Functional Programming Systems Using Haskell. Cambridge, England: Cambridge University Press.
Goerzen, J. & O'Sullivan, B. & Stewart, D. (2008). Real World Haskell. Sebastopol, CA: O'Reilly Media, Inc.
Hutton, G. (2007). Programming in Haskell. New York: Cambridge University Press.
Lipovača, M. (2011). Learn You a Haskell for Great Good!: A Beginner's Guide. San Francisco, CA: No Starch Press, Inc.
Thompson, S. (2011). The Craft of Functional Programming. Edinburgh Gate, Harlow, England: Pearson Education Limited.