2024-02-04

Finding the Line Tangent to a Curve

The tangent line to a curve has many different applications and uses in many different disciplines.

Let’s start with the concept of a line tangential to a curve.

Starting with a curve

Let’s start with the curve \[ f(x) = \frac 1 3 x^2 + 2 \] and generate a plot using the below code

x <- c(seq(-10, 10, by=0.1))
square <- function(x) return((1/3) * (x^2) + 2)
y_f <- square(x)

data <- data.frame(x, y_f)

ggplot(data = data, aes(x=x)) + 
  stat_function(fun = square) + 
  xlim(-10, 10) + 
  ylim(-5, 10)

Plot generated from previous slide’s code

Tangent of the line

The equation of a line tangent to a curve is represented by the equation

\[ \boxed{y - y_1 = m(x - x_1)} \] where m is the slope of the line and (\(x_1, y_1\)) are the coordinates of the point on the line where we want to find the tangent.

The slope (m) can be found via the derivative of the curve which in our case is \[ f(x) = \frac{1}{3} x^2 + 2\\ m = f'(x) = \boxed{\frac{2}{3}x} \]

Finding the tangent line

Now that we know m, we can substitute into our initial equation and solve to find tangent line at a given point (\(x_1\), \(y_1\)). Lets choose a point (3,5) which from the previous equation f’(3) = 2

\[ y - y_1 = f'(x_1)(x - x_1) \] \[ y - 5 = 2(x - 3)\\ y - 5 = 2x - 6\\ \boxed{y = 2x - 1} \]

Plotting the tangent line

Expanding to 3 Dimensions

Extending this concept to functions of 2 variables, we start with a surface instead of a curve.

\[ f(x, y) = - 8x^2 - 12y^2 - 12xy + 5x + 10y + 100 \]

Partial Derivative

For a surface, it is necessary to use the partial derivative in terms of each variable to satisfy the equation of a tangent plane:

Example Calculations

\[ z - f(\alpha, \beta) = f'_x(\alpha, \beta)(x-\alpha) + f'_y(y-\beta) \]

\[ Example : f(x, y) = - 8x^2 - 12y^2 - 12xy + 5x + 10y + 100\\ Evaluated~at (\alpha, \beta) = (2,2)\\ \]

\[ f(2,2) = 8*4-12*4-12*2*2 + 5*2 + 10*2 + 100 = 2\\ f_x(x, y) = 16x -12y + 5 \implies f_x(2, 2) = 16*2 - 12*2 + 5 = -51\\ f'_y(x, y) = -24y - 12x +10 \implies f'_y(2, 2) = -24*2 - 12*2 + 10 = -62\\ \]

\[ \implies z - 2 = -51*(x - 2) + (-62) * (y - 2)\\ \implies z - 2 = -51x + 102 - 62y + 124\\ \implies z = -51x - 62y + 228 \]

Examining the tangent plane

Application of Partial Derivatives

<font size=“4> The vector consisting of partial derivatives is called the gradient. This vector points in the direction of steepest ascent and useful in finding the local max or min of a function. For a function of two variables, x and y:

\[ \nabla f(\alpha, \beta) = <f_x(\alpha, \beta),f_y(\alpha, \beta)> \]

For our previous function evaluating at point (2,2) our gradient vector is

\[ \nabla f(\alpha, \beta) = <-51, -62> \]

This vector points in the direction of the steepest ascent or most rapid increase in the function.