# What is the equation of the line tangent to  f(x)=2x-secx  at  x=pi/4?

Aug 31, 2017

$y - \frac{\pi}{2} + \sqrt{2} = \left(2 - \sqrt{2}\right) \left(x - \frac{\pi}{4}\right)$

#### Explanation:

First of all, find the point the tangent line will intersect:

$f \left(\frac{\pi}{4}\right) = \frac{2 \pi}{4} - \sec \left(\frac{\pi}{4}\right) = \frac{\pi}{2} - \sqrt{2}$

The tangent line passes through $P \left(\frac{\pi}{4} , \frac{\pi}{2} - \sqrt{2}\right)$.

The part that requires calculus is finding the slope of the tangent line at $x = \frac{\pi}{4}$, which will be equal to $f ' \left(\frac{\pi}{4}\right)$.

Differentiating the function:

$f ' \left(x\right) = \frac{d}{\mathrm{dx}} \left(2 x\right) - \frac{d}{\mathrm{dx}} \left(\sec x\right)$

The derivative of $2 x$ is $2$.

To find the derivative of $\sec x$, if you don't have it memorized, I'd use $\sec x = {\left(\cos x\right)}^{-} 1$ then differentiate using the power and chain rule:

$\frac{d}{\mathrm{dx}} {\left(\cos x\right)}^{-} 1 = - {\left(\cos x\right)}^{-} 2 \frac{d}{\mathrm{dx}} \left(\cos x\right) = \frac{- 1}{\cos} ^ 2 x \left(- \sin x\right)$

$= \frac{1}{\cos} x \cdot \sin \frac{x}{\cos} x = \sec x \tan x$

Putting this together,

$f ' \left(x\right) = 2 - \sec x \tan x$

And the slope of the tangent line is

$f ' \left(\frac{\pi}{4}\right) = 2 - \sec \left(\frac{\pi}{4}\right) \tan \left(\frac{\pi}{4}\right) = 2 - \sqrt{2} \left(1\right) = 2 - \sqrt{2}$.

Putting the point $P \left(\frac{\pi}{4} , \frac{\pi}{2} - \sqrt{2}\right)$ and slope $m = 2 - \sqrt{2}$ into the equation of a line:

$y - {y}_{1} = m \left(x - {x}_{1}\right)$

$y - \frac{\pi}{2} + \sqrt{2} = \left(2 - \sqrt{2}\right) \left(x - \frac{\pi}{4}\right)$