@engineer,
Second part:
Reminder: d f(x).g(x) = g(x).df(x) + f(x).dg(x)
f'' = {n f(x) (sec x)}'
= n{ df(x) sec x + f(x) d(sec x) }
We calculated df(x) above and we have d sec(x) from the link I posted.
= n { n f(x) (sec x) (sec x) + f(x) (sec x tan x)}
Factoring out f(x) sec x...
= n f(x) sec x (n sec x + tan x)
but n f(x) sec x = f'(x) so...
= f'(x) (n sec x + tan x)