I will expand this question a little bit:
So, can we use the formula of general solution for wave equation or we should prove/derive it?
Yes, you are allowed to use every appropriate (relevant) formula given in the class without rederiving it (unless specifically asked to derive it first). Definitely you need to ask yourself: "can I apply a formula for a general solution?", "Can I apply D'Alembert formula?"
There is a subtle difference between
allowed and
can: you
can use any appropriate formula but it may happen that you are
explicitly asked to use some specific approach in which case you
are allowed to use only some specific formulae.
P.S. This is my first post here, so I am not sure if I am asking an appropriate question
Yes, it is a completely appropriate question.