Formula use:
\left(a-b\right)^3=a^3-3a^2b+3ab^2-b^3
\left(a+b\right)^3=a^3+3a^2b+3ab^2+b^3
Explanation
Here, given expression is :
\left(a+3b\right)^3-3\left(a+b\right)^2b+3\left(a+3b\right)b^2-b^3
Now, Simplify the expression :
\left(a+3b\right)^3-3\left(a+b\right)^2b+3\left(a+3b\right)b^2-b^3
Let,
\left(a+3b\right)=a
So that, we get :
a^3-3.a^2.b+3.a.b^2-b^3
\therefore\left(a-b\right)^3
Now putting the value of ‘a’ :
\{\left(a+3b\right)-b\}^3
\rightarrow\left(a+3b-b\right)^3
\rightarrow\left(a+2b\right)^3
\rightarrow a^3+3.a^2.2b+3.a.\left(2b\right)^2+\left(2b\right)^3
\therefore a^3+6a^2b+12ab^2+8b^3
Ans: a^3+6a^2b+12ab^2+8b^3\ .