Skip to main content

Local Linear Approximation

You might have seen the famous approximation $\sin(x) \approx x$ for $x$ near 0. We can use derivatives to approximate non-linear functions by simpler linear functions. We can better understand this by looking at the graph a function $f$ under magnification.



The blue curve is the graph of $f(x) = \sin(x)$ and the yellow line is its tangent at $x = 0$. We can see that, under magnification of the curve at the point $x = 0$, the tangent line to the curve at $x = 0$ is a close approximation of the function for $x$ near 0. In general, for a function $f$: if $f$ is differentiable at a point $x_0$, then stronger and stronger magnifications at $(x_0,f(x_0))$ eventually make the curve containing $(x_0,f(x_0))$ look more and more like a non-vertical line segment, that line being the tangent line to the graph of $f$ at $(x_0,f(x)_0))$. Thus, a function $f$ that is differentiable at $x_0$ is said to be locally linear at the point $(x_0,f(x_0))$ . 
By contrast, the graph of a function that is not differentiable at $x_0$ due to a corner at the point $(x_0,f(x_0))$ cannot be magnified to resemble a straight line segment at that point.


The function $f(x) = \lvert x \rvert - 1$ is not differentiable at $x = 0$. We can see the corner at the point $(0,-1)$. The magnification of the graph at the point clearly shows that $f$ is not locally linear at $(0.-1)$.
Now we can discuss this idea analytically. Assume that a function $f$ is differentiable at $x_0$. The equation of the tangent line to the graph of the function through $(x_0,f(x_0))$ is $y = f(x_0) + f'(x_0)(x - x_0)$, where $f'(x_0)$ is the derivative of $f(x)$ at $x_0$. Since this line closely approximates the graph of $f$ for values of $x$ near $x_0$, it follows that

                                    $$f(x) \approx f(x_0) + f'(x_0)(x - x_0)$$

provided that $x$ is close to $x_0$. We call this the local linear approximation of $f$ at $x_0$.

For example,
let $f(x) = \sin(x)$, $f'(x) = \cos(x)$, $f(x) = \sin(0) = 0$ and $f'(x) = \cos(0) = 1$. Therefore,
$$\sin(x) \approx sin(0) + \cos(0)(x - 0)$$
$$\sin(x) \approx 0 + 1(x - 0)$$
$$\sin(x) \approx x.$$


 

Comments

Popular posts from this blog

Visualization of Collatz Conjecture using Python

The Collatz Conjecture The Problem The Collatz conjecture (a.k.a the hailstone problem or the $3n + 1$ problem) was proposed by Lother Collatz  in 1937. Although the problem on which the conjecture is based is really simple that even a fourth-grader can easily understand it, the behaviour of the conjecture makes it exceedingly difficult to prove(or disprove).  First of all, lets define the Collatz map . Let $T : \mathbb{Z}^+ \rightarrow \mathbb{Z}^+$ be defined by The conjecture is that for every positive integer $n$, there exists a $k$ such that  $T^k(n) = 1$. Let us consider an example. As mentioned above, the conjecture states that this is true for any positive integer n. But what makes this problem interesting is that even after 60  years since its proposal nobody has been able to prove (or disprove) it. Mathematicians say the "Mathematics is yet not ready to tackle such problems." So far the conjecture has been checked for all starting values up to $87 \times...

Monte Carlo Integration using Python

 Monte Carlo Integration Monte Carlo integration is a  powerful method of computing the value of complex integrals using probabilistic techniques. This technique uses random numbers to compute the definite integral of a function. Here we are going to use the python programs written in the  previous post  to generate pseudorandom numbers and approximate the value of the definite integral of a function. Consider a function to be integrated, as shown below: That is we need to evaluate the definite integral $\int_{a}^{b} f(x)\mathrm{d}x$. The integral is just the area under the curve. The width of the interval $(b- a)$ times the average value of the function is also the value of the integral, that is, $\int_{a}^{b}f(x)\mathrm{d}x = (b - a)f_{average} = (b-a)\langle f \rangle$ So if we had some independent way of calculating the average value of the integrand, then we could evaluate the integral. This is where random numbers come in. Imagine that we had a list of random n...

Generating Sexy Prime Pairs using Python

Sexy Primes, What are they? They are prime numbers that differ by 6. For example, 5 & 11,  7 & 13. The name comes from the Latin word for six; sex. What we are going to do is, write a program to generate all the sexy prime pairs within a given interval of natural numbers.  Sexy Prime Pairs This is a program to generate all the sexy prime pairs below 10000. Program def check_prime(n):     for i in range(2,n//2+1):         if n%i == 0:     return False     return True def primes_list(a,b):     primes_list = []     for i in range(a,b):         if check_prime(i):     primes_list.append(i)     return (primes_list) def sexy_list(primes_list):     sexy_list = []     for i in primes_list:         for j in primes_list:     if j-i == 6:         sexy_list.append((i,j))     return(sexy_...