How to find the tangent line to a curve#


A tangent line is a line that intersects a curve in only one point. As we will see, being able to determine the equation for a tangent line is important for Physics - and is a useful skill in a broad variety of applications.

Lines may be defined in a number of ways. The general form is:

\(y-y_1=m(x-x_1)\)

where the line passes through the point \((x_1,y_1)\) and \(m\) is the slope of the line, measured by the ratio of rise to run between any two points on the line. This is the form we will use to find the line tangent to a curve at a given point.

Calculate the tangent line of a point on a trigonometric function#


Let's create a sine wave in desmos with the function:

\(f(x)=\sin x\)

Sine wave with a period of 2 pi
Sine wave with a period of 2 pi

This sine wave has an amplitude of \(1\) and a period of \(2\pi\), so let's create a vertical line which can float from \(x=-\pi\) to \(x=\pi\) and call it \(x_1\).

Now that we have defined \(x_1\) we can plug that value into our function to calculate \(f(x_1)\). For instance, if \(x_1=\pi\) then \(f(x_1)=\sin\pi=0\). This is the function's first positive intersection the x-axis. Likewise, if \(x_1=\frac{\pi}{2}\) then \(f(x_1)=\sin\frac{\pi}{2}=1\). This is the amplitude - the peak of the wave.

As you slide the \(x_1\) variable back and forth between \(-\pi\) and \(\pi\), \(f(x_1)\) is just the y-axis position of the curve at that point. We have \(x_1\) and \(y_1\); now we just need to calculate the slope.

We calculate the slope of the tangent line by finding the derivative of our curve at \(x_1\). You may recall that the derivative of \(\sin x_1\) with respect to \(x_1\) is \(\cos x_1\). There is an elegant proof for this, but for a shortcut, refer to this table to find derivatives of trig functions. We will explore a curve without trig functions in a moment.

We can now calculate the slope of the tangent line for any point on the curve; this is actually what a derivative is. Here is the calculation of the tangent line for \(\sin x_1\) when \(x_1=2.75\):

\(f(x)=\sin x\)

\(x_1=2.75\)

\(y_1=f(x_1)=\sin 2.75\approx 0.38166\)

\(m=f'(2.75)=\cos 2.75\approx -0.9243\)

\(y-y_1=m(x-x_1)\)

\(y-\sin 2.75=\cos 2.75(x-2.75)\)

\(y\approx -0.924302x+2.92349\)

Calculate the tangent line of a point on a semicircle#


Here is an example I created in desmos of a line tangent to a semicircle. The semicircle I'm using is calculated from the equation for a unit circle.

\(x^2+y^2=1\)

\(y^2=1-x^2\)

\(y=\pm\sqrt{1-x^2}\)

The positive equation forms the top half of a circle, while the negative equation forms the bottom half of the circle.

Note

A circle has an equation, but is not a function. A function cannot violate the vertical line rule, meaning that an x-value may not have more than one associated y-value. However, each semicircle is a function.

\(x_1\) may be any value: \(-1<x_1< 1\). It cannot be -1 or 1 because the slope of the tangent line is undefined at those values.

\(y_1=f(x_1)\)

\(m=f'(x_1)=\frac{d}{dx_1}\sqrt{1-x_1^2}\)

To take the derivative of \(\sqrt{1-x^2}\) we can use the chain rule:

\(\frac{d}{dx}f[g(x)]=f'[g(x)]\cdot g'(x)\)

\(g(x)=1-x^2\)

\(\frac{1}{2}{g(x)}^{-\frac{1}{2}}\cdot g'(x)\)

\(\frac{1}{2}({1-x^2})^{-\frac{1}{2}}\cdot -2x\)

\(\frac{-2x}{2\sqrt{1-x^2}}=\frac{-x}{\sqrt{1-x^2}}\)

Now that we know the derivative of \(\sqrt{1-x^2}=\frac{-x}{\sqrt{1-x^2}}\) we have the slope of the tangent line. Let's look at an example which uses this information. Let \(x_1=0.312\)

\(x_1=0.312\)

\(y_1=f(0.312)=\sqrt{1-0.312^2}=0.950\)

\(f'(x)=\frac{-x}{\sqrt{1-x^2}} \implies\)

\(m=f'(0.312)\frac{-0.312}{\sqrt{1-0.312^2}}=-0.328\)

\(y-y_1=m(x-x_1) \implies\)

\(y-0.950=-0.328(x-0.312)\)

\(y=-0.328x+0.102+0.950\)

\(y=-0.328x+1.052\)