How do I calculate the power dissipation of the transistor?
From the datasheet I found that Pmax=500mW.
The power dissipated by a resistor is the voltage across it multiplied by the current in it.
A transistor is exactly the same.
The power dissipated by a transistor is also the voltage across it multiplied by the current in it.
8V x 6mA= 48mW so the transistor will be slightly warm.
The signal is a sinewave that swings equally positive and negative so it does not change the power dissipation.