Derivatives of the charge.
Q˙=6cos(2t),Q¨=−12sin(2t)
Kirchhoff’s law (series loop). With i=−Q˙, summing the drops across L, R, C:
ΔVgen=−LQ¨−RQ˙−CQ=−4(−12sin2t)−3⋅6cos2t−23sin2t
ΔVgen(t)=48sin2t−18cos2t−23sin2t=−18cos(2t)+293sin(2t)
ΔVgen(t)=−18cos(2t)+293sin(2t)
Energy balance. The current is i=−Q˙=−6cos(2t). Stored energy:
E(t)=2CQ2+2Li2=49sin22t+24⋅36cos22t=49sin22t+72cos22t
dtdE=49⋅4sin2tcos2t−72⋅4sin2tcos2t=(9−288)sin2tcos2t=−279sin2tcos2t
Power delivered by the generator and dissipated by R:
Pgen=ΔVgen⋅i=(−18cos2t+293sin2t)(−6cos2t)=108cos22t−279sin2tcos2t
PR=Ri2=3⋅36cos22t=108cos22t
Pgen−PR=−279sin2tcos2t=dtdE✓
The balance checks out: the net power supplied minus that dissipated in R equals the rate of change of the energy stored in L and C.