To expand a binomial of the form (x+a)^n, we use the Binomial Theorem.
The binomial theorem is as follows:
sum_(k=0)^n((n),(k))x^(n-k)a^k, where ((n),(k))=(n!)/(k!(n-k)!)
Here Pascal's Triangle comes into play. What I wrote above as ((n),(k)), (read as "n choose k") corresponds to the row and column number of a coefficient.
n is the row number, and k the column number.
Use the binomial theorem where x=3x,a=-1,n=5:
sum_(k=0)^5((5),(k))(3x)^(5-k)(-1)^k.
When k=0,
(5!)/(0!(5-0)!)*(3x)^(5-0)(-1)^0
=1*243x^5*1
=243x^5
When k=1,
(5!)/(1!(5-1)!)*(3x)^(5-1)(-1)^1
=5*81x^4*-1
=-405x^4
When k=2,
(5!)/(2!(5-2)!)*(3x)^(5-2)(-1)^2
=10*27x^3*1
=270x^3
When k=3,
(5!)/(3!(5-3)!)*(3x)^(5-3)(-1)^3
=10*9x^2*-1
=-90x^2
When k=4,
(5!)/(4!(5-4)!)*(3x)^(5-4)(-1)^4
=5*3x*1
=15x
When k=5
(5!)/(5!(5-5)!)*(3x)^(5-5)(-1)^5
=1*1*-1
=-1
Add up all your answers, and you get:
243x^5-405x^4+270x^3-90x^2+15x-1
Which is your answer.