So we initially have the relationship y = ln(sin(3x)). As the left hand side is a function of the variable y and the right hand side is a function of the variable x i.e they are implicitly related, we need to use implicit differentiation. This means we differentiate each side of the equation seperately with respect to the functional variable, in this case x. Now differentiate the LHS, which is simple enough
d/dx(y) = dy/dx = f'(x)
To differentiate the RHS, we note that the differential of a logarithm ln(g(x)) is given by g'(x) / g(x), a relationship that can be found easily by integrating. So in this example we have that g(x) = sin(3x), therefore we need to use the chain rule to differentiate it. The differential of sin(3x) is thus cos(3x) multiplied by the differential of 3x which is 3, therefore g'(x) = 3cos(3x) and so the differential of the RHS is 3cos(3x)/sin(3x) = 3cot(3x)
We thus have dy/dx = 3cot(3x)