Equations and relations we're going to use here:
(1) Product rule: [f(x)*g(x)]' = f(x)*g'(x) + f'(x)*g(x)
(2) Derivative of sin/cos: sin'(x) = cos(x) , cos'(x) = -sin(x)
(3) Chain rule: [g(f(x))]' = g'(f(x))*f'(x). ie: sin'(9x)=cos(9x)*9
First derivative:
It will be convenient to define:
f(x) = 2cos(x)
g(x) = cos(9x)
Derivative of a product of two functions:
(eq.1) (f(x)*g(x))' = f(x)*g'(x) + f'(x)*g(x)
In this case:
f'(x) = (2cos(x))' = 2*cos'(x) = 2*(-sin(x)) = -2sin(x)
g'(x) = (cos(9x))' = -sin(9x)*9 = -9sin(9x)
We plug those back in eq.1:
(2cos(x)cos(9x))' = 2cos(x)*(-9sin(9x))+(-2sin(x))*cos(9x)) = ..
.. = -18cos(x)sin(9x) - 2sin(x)cos(9x)
Second derivative:
The derivative of -18cos(x)sin(9x):
define: f(x) = -18cos(x) , g(x) = sin(9x)
now
f'(x) = -18cos'(x) = -18*(-sin(x)) = 18sin(x)
g'(x) = sin'(9x) = 9cos(9x)
and so, like we did above:
(-18cos(x)sin(9x))' = -18cos(x)*9cos(9x) + 18sin(x)*sin(9x) = ..
.. = -162cos(x)cos(9x) + 18sin(x)sin(9x)
The derivative of -2sin(x)cos(9x):
define: f(x) = -2sin(x) , g(x) = cos(9x)
and now:
f'(x) = -2sin'(x) = -2cos(x)
g'(x) = cos'(9x) = -9sin(9x)
-2sin(x)cos(9x) = (-2sin(x))(-9sin(9x))+(-2cos(x)cos(9x)) = ..
.. = 18sin(x)sin(9x) - 2cos(x)cos(9x)
So finally, the derivative of -18cos(x)sin(9x)-2sin(x)cos(9x) is:
-162cos(x)cos(9x) + 18sin(x)sin(9x) + 18sin(x)sin(9x) - 2cos(x)cos(9x) = ..
.. = 36sin(x)sin(9x) - 164cos(x)cos(9x)