# What is the equation of the tangent line of f(x) =sqrt(tanx-sinx) at  x = pi/4?

Sep 7, 2017

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

#### Explanation:

Find the $y$-coordinate of the point the tangent line will pass through:

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

There are a lot of ways to write this, so we'll just leave it alone. The tangent line passes through the point $\left(\frac{\pi}{4} , \sqrt{1 - \frac{1}{\sqrt{2}}}\right)$.

We also need to find the slope of the tangent line, which we can do by evaluating the derivative of the function at $x = \frac{\pi}{4}$. I'd start by writing the square root as a power of $\frac{1}{2}$, and then differentiating the function using the chain rule.

$f \left(x\right) = {\left(\tan x - \sin x\right)}^{\frac{1}{2}}$

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

Note that $\frac{d}{\mathrm{dx}} \tan x = {\sec}^{2} x$ and $\frac{d}{\mathrm{dx}} \sin x = \cos x$:

$f ' \left(x\right) = \frac{1}{2} {\left(\tan x - \sin x\right)}^{- \frac{1}{2}} \left({\sec}^{2} x - \cos x\right)$

$f ' \left(x\right) = \frac{{\sec}^{2} x - \cos x}{2 \sqrt{\tan x - \sin x}}$

So the slope of the tangent line at $x = \frac{\pi}{4}$ is:

f'(pi/4)=(sec^2(pi/4)-cos(pi/4))/(2sqrt(tan(pi/4)-sin(pi/4))

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

Multiplying through by $\frac{\sqrt{2}}{\sqrt{2}}$:

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

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

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

Now that we know the slope of the tangent line and a point it passes through, which is $\left(\frac{\pi}{4} , \sqrt{1 - \frac{1}{\sqrt{2}}}\right)$, we can write the equation of the tangent line in point-slope form:

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

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