# What is the equation of the normal line of f(x)= xsinx-cos^2x at x = pi/8?

Jun 22, 2018

$y = - 0.69 x - 0.43$ [To 2D]

#### Explanation:

$f \left(x\right) = x \sin x - {\cos}^{2} x$

Apply product rule, chain rule and standard derivatives.

$f ' \left(x\right) = x \cos x + \sin x - 2 \cos x \cdot \left(- \sin x\right)$

$= x \cos x + \sin x + 2 \sin x \cos x$

$= x \cos x + \sin x + \sin \left(2 x\right)$

The slope of $f \left(x\right)$ at $x = \frac{\pi}{8}$ is $f ' \left(\frac{\pi}{8}\right)$

$f ' \left(\frac{\pi}{8}\right) = \frac{\pi}{8} \cdot \cos \left(\frac{\pi}{8}\right) + \sin \left(\frac{\pi}{8}\right) + \sin \left(\frac{\pi}{4}\right)$

$\approx 1.542597$ (Calculator)

The slope of a tangent (${m}_{1}$) $\times$ slope of a normal (${m}_{2}$) at any point on a curve is given by: ${m}_{1} \cdot {m}_{2} = - 1$

$\therefore$ Slope of the normal to $f \left(x\right)$ at $x = \frac{\pi}{8} \approx - \frac{1}{1.542597}$

$\approx - 0.688422$

The equation of a straight line of slope $m$ passing through the point $\left({x}_{1} , {y}_{1}\right)$ is given by:

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

In this example, our normal will have the equation:

$y - f \left(\frac{\pi}{8}\right) \approx - 0.688422 \left(x - \frac{\pi}{8}\right)$

$y - \left(- 0.703274\right) \approx - 0.688422 \left(x - 0.392699\right)$ (Calculator)

$y + 0703274 \approx - 0.688422 x + 0.270343$

$y \approx - 0.688422 x - 0.432931$

$y = - 0.69 x - 0.43$ [To 2D]

We can see $f \left(x\right)$ and the normal at $x = \frac{\pi}{8}$ on the graphic below.