Let's assume your demand function is Q(P) = 55 - P, and the supply function is P = 25. What is the excise tax that maximizes revenue for the government?

Now let's assume that your supply function is Q(P) = 5 + 3P. What is the excise tax that maximizes revenue for the government?

I tried to figure it out but it wasn't working for me

Any help would be of great appreciation!