Question: a. Find the equation of the line tangent to the function at the given value of $x$. b. Graph the function and the tangent line on the same graph. y = tangent x; x = -\frac{\pi}{4}
1. **State the problem:** Find the equation of the tangent line to the function $y = \tan x$ at $x = -\frac{\pi}{4}$. Then graph both the function and the tangent line.
2. **Recall the formula for the tangent line:** The tangent line to $y = f(x)$ at $x = a$ is given by:
$$y = f(a) + f'(a)(x - a)$$
where $f'(a)$ is the derivative of $f$ evaluated at $x = a$.
3. **Find $f(a)$:**
$$f\left(-\frac{\pi}{4}\right) = \tan\left(-\frac{\pi}{4}\right) = -1$$
4. **Find the derivative $f'(x)$:**
$$f'(x) = \sec^2 x$$
5. **Evaluate the derivative at $x = -\frac{\pi}{4}$:**
$$f'\left(-\frac{\pi}{4}\right) = \sec^2\left(-\frac{\pi}{4}\right) = \left(\frac{1}{\cos\left(-\frac{\pi}{4}\right)}\right)^2 = \left(\frac{1}{\frac{\sqrt{2}}{2}}\right)^2 = (\sqrt{2})^2 = 2$$
6. **Write the equation of the tangent line:**
$$y = f(a) + f'(a)(x - a) = -1 + 2\left(x + \frac{\pi}{4}\right)$$
7. **Simplify the tangent line equation:**
$$y = -1 + 2x + \frac{\pi}{2} = 2x - 1 + \frac{\pi}{2}$$
**Final answer:**
$$\boxed{y = 2x - 1 + \frac{\pi}{2}}$$
8. **Graphing:** The function $y = \tan x$ and the tangent line $y = 2x - 1 + \frac{\pi}{2}$ should be graphed on the same axes with window $[-2\pi, 2\pi]$ for $x$ and $[-4,4]$ for $y$.