### An intro to continuous functions

Several spheres of calculus need a comprehension of continuous functions. The traits of continuous functions, and the research of points of discontinuity are of massive interest to the mathematical community. Owing to their critical attributes, continuous functions have practical applications within machine learning algorithms and optimization strategies.

In this guide, you will find out what continuous functions are, their attributes, and two critical theorems in the research of optimization algorithms that is, intermediate value theorem and extreme value theorem.

After going through this guide, you will be aware of:

- Definition of continuous functions
- Intermediate value theorem
- Extreme value theorem

__Tutorial Overview__

- Definition of continuous functions
- Informal definition
- Formal definition

- Theorems
- Intermediate value theorem
- Extreme value theorem

__Prerequisites__

This guide necessitates a comprehension of the concept of limits. To give your memory a refresh, you can look forward to our upcoming article on limits and continuity, where continuous functions are also briefly defined. In this guide, we delve into comprehensive details.

We’ll also leverage intervals. So square brackets mean closed intervals (consist of the boundary points) and parenthesis mean open intervals (do not consist of boundary points), for instance,

- [a,b] means a<=x<=b
- (a,b) means a<x<b
- [a,b) means a<=x<b

From the above, you can observe that an interval can be open on one side and closed on the other.

As a final point, we’ll only be talking about real functions defined over real numbers. We won’t be talking about complicated numbers or functions defined on the complex plane.

__An informal definition of continuous functions__

Let’s assume we possess a function f(x). It is simple to check if it is continuous between two points a and b, if we can plot the graph of f(x) without requiring to lift our hands. As an instance, think of a straight line defined as:

f(x) = 2x+1

We can draw the straight line between [0,1] without requiring to lift our hands. As a matter of fact, we’ll only be detailing real functions defined over real numbers. We won’t be talking about complicated numbers or functions defined on the complex plane.

__An informal definition of continuous functions__

Let’s assume we possess a function f(x). It is simple to check if it is continuous between two points a and b, if we can go about plotting the graph of f(x) without requiring to lift our hand. As an instance, think of a straight line defined as:

f(x) = 2x+1

We can draw the straight line between [0,1] without requiring to lift our hand. As a matter of fact, we can draw this line between any two values of x and we will not have to lift our hand (see image below). Therefore, this function is continuous over the total domain of real numbers. Now let’s observe what occurs when we plot the ceil function:

The ceil function has a value of 1 on the interval (0,1], for instance, ceil (0.5) = 1, ceil (0.7) = 1, and so on. As an outcome, the function is continuous over the domain (0,1]. If we modify the interval to (0.2], ceil (x) jumps to 2 as soon as x>1. To plot ceil (x) for the domain (0,2], we must now lift our hand and begin plotting again at x=2. As an outcome, the ceil function isn’t a continuous function.

If the function is continuous over the total domain of real numbers, then it is a continuous function as a whole, otherwise, it is not continuous as whole. For the later type of functions, we can look over which interval they are continuous.

__A Formal Definition__

A function f(x) is continuous at a point a, if the function’s value approaches f(a) when x gets close to a. Therefore, to evaluate the continuity of a function at a point x=a, check the following:

- f(a) should exist
- f(x) possesses a limit as x gets close to a
- The limit of f(x) as x->a is equivalent to f(a)

If all of the above hold good, then the function is continuous at the point a:

__Instances__

Some instances are listed below and also demonstrated in the figure:

- f(x) = 1/x is not continuous as it is not defined at x=0. But, the function is continuous for the domain x>0.
- All polynomial functions are continuous function.
- The trigonometric functions sin(x) and cos(x) are continuous and oscillate between the values -1 and 1.
- The trigonometric function tan(x) is not continuous as it is undefined at x=?/2, x=-?/2
- Sqrt(x) is not continuous as it is not defined for x<0.
- [x] is continuous everywhere.

__Connection of Continuity with Function Derivatives__

From the definition of continuity with regards to limits, we have an alternative definition. f(x) is continuous at x, if:

f(x+h) – f(x)→ 0 when (h→0)

Let’s observe the definition of a derivative:

f’(x) = lim(h→0) (f(x+h)-f(x))/h

Therefore if f’(x) exists at a point a, then the function is continuous at a. The converse is not always true. A function might be continuous at a point a, but f’(a) may not exist. For instance, in the above graph [x] is continuous everywhere. We can draw it without requiring to lift our hands, but, at x=0 its derivative does not exist because of the sharp turn in the curve.

__Intermediate value theorem__

The intermediate value theorem specifies that:

If:

- Function f(x) is continuous on [a,b]
- And f(a) <= K <= f(b)

Then:

- There is a point c between a and b, that is, a<=c<=b such that f(c) = K

In simple terms, this theorem specifies that if a function is continuous over [a,b] then all values of the function between f(a) and f(b) will exist within this interval as displayed in the image below:

__Extreme Value Theorem__

This theorem specifies that:

If:

- Function f(x) is continuous on [a,b]

Then:all

- There are points x_min and x_max inside the interval [a,b], that is,
- a<=x_min<=b
- a<=x_max<=b

- and the function f(x) has a minimum value f(x_min), and a maximum value f(x_max), that is
- f(x_min) <=f(x) <=f(x_max) when a<=x<=b

To put it in other words, a continuous function always possesses a minimum and maximum value within an interval as demonstrated in the figure above.

__Continuous Functions and Optimization__

Continuous functions are very critical in the research of optimization issues. We can observe that the extreme value theorem ensures that within an interval, there will always be a point where the function possesses a maximum value. The same can be stated for a minimum value. Several optimization algorithms are obtained from this basic attribute and can execute amazing activites.

__Extensions__

This section details some concepts for extension of the guide that you may desire to explore.

- Converging and diverging sequences
- Weierstrass and Jordan definitions of continuous functions on the basis of infinitesimally small constants