### An intro to continuity and limits

There is no denial that calculus is a tough subject. But, if you learn the basics, you will not only be capable of understanding the more intricate theories but also discover them to be interesting. To comprehend machine learning (ML) algorithms, you require to comprehend theories like gradient of a function, hessians of a matrix, and optimization, etc. The theory of limits and continuity functions as a base for all of these subjects.

In this blog article, you will find out how to assess the limit with regards to a function, and how to decide if a function is continuous or if it isn’t. After going through this article, you will be capable of:

- Deciding if a function f(x) has a limit as X gets to a specific value
- Assess the limit of a function f(x) as x get close to a
- Decide if a function is ongoing at a point or in an interval

**Tutorial Summary**

This tutorial is demarcated into two portions.

- Limits
- Decide if the limit of a function is in existence for a specific point
- Computing the limit of a function for a specific point
- Formal definition of a limit
- Instances of limits
- Right and left hand limits

- Continuity
- Definition of continuity
- Decide if a function is ongoing at a point or inside of an interval
- Instances of continuous functions

**A simplistic instance**

Let’s begin by observing a simplistic function f(x) provided by: f(x) = 1+x

What occurs to f(x) near -1?

We can observe that f(x) begins to approach to zero as x gets in proximity to -1, from either side of x=-1, at x=-1, the function is precisely 0. We state that f(x) has a limit equivalent to 0, when x gets close to -1.

**Extension of the instance **

Extending the issue, let’s define g(x):

g(x) = (1-x)(1+x)/(1+x)

If the denominator is not zero then g(x) can be simplified as follows:

g(x) = 1-x, if x is not equal to -1.

However, at (x=1), the denominator is zero and we are unable to divide it by zero. So it appears that there is a hole in the function a x=-1. Regardless of the existence of this hole, g(x) gets in closer proximity to 2 as x gets in closer proximity to -1 as illustrated in the figure.

This is the fundamental concept of a limit. If g(x) has definition in an open interval that does not consist of -1, and g(x) gets closer in proximity to 2, as x gets closer to -1, we would represent this as:

Lim(xà-1 g(x) = 2

Generally, for any function f(x), if f(x) gets in closer proximity to a value L, as x gets nearer and nearer to k, we go about defining the limit of f(x) as x approaches k, as L. This is written as:

lim f(x) = L

x à k

Right and left hand limits

For the function g(x), it doesn’t make a difference if we increase to get x nearer to -1 (approach -1 from left) or reduce x to get nearer to -1, (approach -1 from left) or reduce x to get nearer to -1 (approach -1 from right) g(x) still gets nearer and nearer to 2. This is demonstrated in the figure below:

This gives prevalence to the notion of one-sided limits. The left hand limit is defined on an interval to the left of -1, which does not consist of -1, e.g. (-1.003, -1). As we get close to -1 from the left, g(x) gets nearer to 2.

Likewise, the right hand limit gets definition on an open interval to the right of -1 and doesn’t consist of -1, e.g. (-1, 0.997). As we get closer to -1 from the right, the right hand limit of g(x) is 2. Both the right and left hand limits are written as follows:

We state that f(x) has a limit l as x gets close to k, both its right and left limits are equivalent. Thus, it is another way of evaluating if a function has a limit at a particular point. i.e.,

**Formal definition of a limit**

In mathematics, we are required to have a precise definition of everything. In order to go about defining a limit formally, we’ll leverage the notion of the Greek letter ?. The mathematics community concurs to use it for random small positive numbers, which implies we can make it as little as we prefer and it can be as near to zero as we prefer, provided it is >0 (therefore, it cannot be equal to zero)

The limit of f(x) is L as x approaches k, for every ? > 0, there is a positive number ?>0, such that: if 0<|?−?|<? then |?(?)−?|<?

The definition is pretty direct, x-k is the difference of x from k and |x-k| is the distance of k from x that disregards the sign of the difference. Likewise, |f(x)-L| is the distance of f(x) from L. Therefore, the definition states that the distance of k from x gets close to a random small value, the distance of f(x) from L also gets close to a really small value. The figure below is a good demonstration of the above definition.

**Examples of limits**

The figure below demonstrates a few instances, which are also detailed below:

**Instance with absolute value**

f_1(x) = |x|

The limit of f_1(x) is existent at all values of x, for e.g., lim(xà0) f_1(x) = 0.

**Instance with a polynomial**

f_2(x) = x^2 + 3x + 1

The limit of f_2 (x) is in existence for all values of x, e.g., lim(xà1) f_2(x) = 1+3+1=5.

**Instance with infinity**

f_3(x) = 1/x, if x>0

f_3(x) = 0, if x<=0

For the above, as x gets bigger and bigger, the value of f_3(x) becomes lesser and lesser, approaching zero. Therefore, lim(xàinfinity) f_3(x) = 0.

**Instance of functions that don’t have a limit**

From the definition of the limit, we can observe that the following functions do not have a limitation:

**The Unit Step Function**

The unit step function H(x) is provided by:

H(x) = 0, if x<0.

H(x) = 1, otherwise

As we get nearer and nearer to zero from the left, the function stays as zero. But, as we reach x = 0, H(x) shifts to 1, and therefore H(x) doesn’t have a limitation as x gets closer to 0. This function possesses a left hand limit equivalent to zero and a right hand limit equivalent to 1.

The right and left hand limits do not concur, a xà0, therefore, H(x) doesn’t have a limitation as x gets to zero. Here, we leveraged the equality of right and left hand limits as an assessment to test if a function has a limit at a specific point.

**The reciprocal function**

Consider h_1(x):

h_1(x) = 1/(x-1)

As get closer to x=1 from the left side, the function has a tendency to have big negative values. As we get closer to x=1, from the right, h_1(x) becomes expands to big positive values. Therefore when x is closer to 1, the values of h_1(x) do not remain close to a static real value. Therefore, the limit is not in existence for xà1.

**The Ceil Function**

Consider the ceil function that rounds an actual number with a non-zero fractional portion to the next integer value. Therefore, lim(xà1) ceil(x) is not in existence. As a matter of fact, ceil(x) does not have a limitation at any integer value.

All the above instances are demonstrated in the figure below:

**Continuity**

If you have comprehended the concept of a limit, then it is simple to comprehend continuity. A function f(x) is ongoing at a point a, if the following three stipulations are met:

- f(a) should be in existence
- f(x) has a limit as x get close to a
- The limit of f(x) as xàa is equivalent to f(a)

If all of the above stipulations hold good, then the function is continuous at the juncture a. Few instances follow.

**Instances of continuity**

The theory of continuity has a close relationship with limits. If the function has its definition at a point, has no jumps at that particular point, and has a limit at that point, then it is considered to be continuous at that point. The figure below demonstrates some instances, which are detailed below:

**The square function**

This function f_4 (x) is continuous for all values of x.

f_4(x)=x^2

**The rational function**

Our prior leveraged function g(x):

g(x) = (1-x^2)/(1+x)

g(x) is ongoing everywhere except at x=-1.

We can alter g(x) as g*x

g*(x) = (1-x^2) / (1+x), if x is not equal to -1.

g*(x) = 2, otherwise

We presently possess a function that is continuous for all values of x.

**The Reciprocal Function**

Going back to our previous instance of f_3(x):

f_3(x) = 1/x, if x>0

f_3(x) = 0, if x <=0

f_3(x) is continuous in all places, except at x=0, as the value of f_3(x) has a big elevation at x=0. Therefore, there is a break in continuity at x=0.

**Conclusion**

In this article, you learned about calculus theories of limits and continuity.

Particularly, you learned

- If a function has a limitation when getting close to a point
- If a function is continuous at a point or in an interval