Since both terms are perfect squares, factor using the difference of squares formula, where and .

Apply the distributive property.

Apply the distributive property.

Apply the distributive property.

Combine the opposite terms in .

Reorder the factors in the terms and .

Add and .

Add and .

Simplify each term.

Multiply .

Raise to the power of .

Raise to the power of .

Use the power rule to combine exponents.

Add and .

Rewrite using the commutative property of multiplication.

Multiply .

Raise to the power of .

Raise to the power of .

Use the power rule to combine exponents.

Add and .

Apply the cosine double–angle identity.

Multiply by .

Simplify cos(3x)^2-sin(3x)^2