Find the first derivative -> the slope function:
f'(x) = cos x - (-sin 2x)(2) = cos x + 2 sin 2x
Find the slope of the tangent line: m_t = f'(pi/8) = cos(pi/8) + 2 sin(pi/4) = sqrt(2+sqrt(2))/2 + (2sqrt(2))/2
m_t = (sqrt(2+sqrt(2)) + 2sqrt(2))/2
The normal line is the perpendicular line which the negative reciprocal of the tangent line for its slope:
m_n = -2/(sqrt(2+sqrt(2)) + 2sqrt(2))
y_n -y_1= m_n(x - x_1)
f(pi/8) = sin(pi/8) - cos(pi/4) = (sqrt(2-sqrt(2)))/2 - sqrt(2)/2 = ((sqrt(2-sqrt(2)))- sqrt(2))/2
y_n -y_1= m_n(x - x_1):
y_n-((sqrt(2-sqrt(2)))- sqrt(2))/2 = -2/(sqrt(2+sqrt(2)) + 2sqrt(2))(x-pi/8)
y_n = -(2x)/(sqrt(2+sqrt(2)) + 2sqrt(2)) + pi/(4(sqrt(2+sqrt(2)) + 2sqrt(2))) + ((sqrt(2-sqrt(2)))- sqrt(2))/2