Declare theta and phi as functions, and then substitute after differentiating A
syms phi(t) theta(t) phi_dot(t) theta_dot(t)
A=[1 0 -sin(theta);0 cos(phi) cos(theta)*sin(phi);0 -sin(phi) cos(phi)*cos(theta)]
subs(diff(A,t),diff([phi(t) theta(t)]),[phi_dot(t) theta_dot(t)])
Note that this result is not the same as the expected result in the question, which appears to have some terms that are incorrect.