Given that $(q,p)$ are canonical coordinates, determine the function $f$ such that the transformation
$$ Q=f(q)\cos{p}, \quad P=f(q)\sin{p} $$
is canonical
I have made good progress using the Jacobian characterisation method to calculate a solution but Im having trouble understanding the solution using poisson bracket calculations
The solution starts with
\begin{align} \{ Q, P\} &= \{ f(q)\cos{p},f(q)\sin{p} \} \\ &=f(q)\sin{p}\{\cos{p},f(q)\}+f(q)\cos{p}\{f(q),\sin{p}\} \\ &=-f(q)f'(q)\sin^2{p}\{p,q\}+f(q)f'(q)\cos^2{p}\{q,p\}\\ &=\;... \end{align}
How do we go from the first line to the second line?
It doesn't seem to fall into the fundamental properties of the poisson bracket as far as I can see.