How to factor by common factoring?

T[Q_,x_,y_] := {{Cos[Q], -Sin[Q], x}, {Sin[Q], Cos[Q], y}, {0, 0 ,1}};
T01=T[Q1,0,0]; MatrixForm@T01

T02=T(Q2, xB,0]; MatrixForm@T02

T10=Simplify@Inverse[T01]; MatrixForm@T10

T12=Simplify[T10.T02]; MatrixForm@T12

I have this exercise and in my last output (output[65]) I want collect “THETA1” (in the image and “Q” in the code) in this way:

I don’t know how to do it. Someone can hep me?

Welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1ST

The rules explain how to format your code properly. Posting code Images doesn’t help other members to copy your code. Please EDIT your post and make sure code blocks start on a new paragraph and look framed and colored like this.

int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]

You can also embed notebook or attach notebook.

Mapping Factor over the expression: