Hi, I have the equation below and I'm trying to use "collect " to get the coefficient of dudy^2 and dvdx^2. I tried

aa1 := subs({gamma[1] = alpha[3]-alpha[2], gamma[2] = alpha[6]-alpha[5]}, collect(aa, {dudy^2, dvdx^2}))

But is not collecting the coefficient of dvdx^2. Please can someone help?

aa := alpha[1]*(cos(theta(x, y, t))^4*dudx^2+2*cos(theta(x, y, t))^3*dudx*sin(theta(x, y, t))*dvdx+2*cos(theta(x, y, t))^3*dudx*sin(theta(x, y, t))*dudy+2*cos(theta(x, y, t))^2*dudx*sin(theta(x, y, t))^2*dvdy+cos(theta(x, y, t))^2*sin(theta(x, y, t))^2*dvdx^2+2*cos(theta(x, y, t))^2*sin(theta(x, y, t))^2*dvdx*dudy+2*cos(theta(x, y, t))*sin(theta(x, y, t))^3*dvdx*dvdy+cos(theta(x, y, t))^2*sin(theta(x, y, t))^2*dudy^2+2*cos(theta(x, y, t))*sin(theta(x, y, t))^3*dudy*dvdy+sin(theta(x, y, t))^4*dvdy^2)+(alpha[2]+alpha[3]+gamma[2])*(-dudx*cos(theta(x, y, t))*sin(theta(x, y, t))*thetadot-(1/2)*dudx*cos(theta(x, y, t))*sin(theta(x, y, t))*dudy+(1/2)*dudx*cos(theta(x, y, t))*sin(theta(x, y, t))*dvdx+(1/2)*cos(theta(x, y, t))^2*dvdx*thetadot-(1/4)*cos(theta(x, y, t))^2*dvdx^2+(1/2)*cos(theta(x, y, t))^2*dudy*thetadot+(1/4)*cos(theta(x, y, t))^2*dudy^2-(1/2)*sin(theta(x, y, t))^2*dvdx*thetadot+(1/4)*sin(theta(x, y, t))^2*dvdx^2-(1/2)*sin(theta(x, y, t))^2*dudy*thetadot-(1/4)*sin(theta(x, y, t))^2*dudy^2+dvdy*sin(theta(x, y, t))*cos(theta(x, y, t))*thetadot-(1/2)*dvdy*sin(theta(x, y, t))*cos(theta(x, y, t))*dvdx+(1/2)*dvdy*sin(theta(x, y, t))*cos(theta(x, y, t))*dudy)+alpha[4]*(dudx^2+(1/2)*dvdx^2+dvdx*dudy+(1/2)*dudy^2+dvdy^2)+(alpha[5]+alpha[6])*(cos(theta(x, y, t))^2*dudx^2+2*cos(theta(x, y, t))*dudx*((1/2)*dvdx+(1/2)*dudy)*sin(theta(x, y, t))+cos(theta(x, y, t))^2*((1/2)*dvdx+(1/2)*dudy)^2+2*cos(theta(x, y, t))*((1/2)*dvdx+(1/2)*dudy)*dvdy*sin(theta(x, y, t))+sin(theta(x, y, t))^2*((1/2)*dvdx+(1/2)*dudy)^2+sin(theta(x, y, t))^2*dvdy^2)+gamma[1]*(sin(theta(x, y, t))^2*thetadot^2+sin(theta(x, y, t))^2*dudy*thetadot-sin(theta(x, y, t))^2*dvdx*thetadot+(1/4)*sin(theta(x, y, t))^2*dudy^2-(1/2)*sin(theta(x, y, t))^2*dudy*dvdx+(1/4)*sin(theta(x, y, t))^2*dvdx^2+cos(theta(x, y, t))^2*thetadot^2-cos(theta(x, y, t))^2*dvdx*thetadot+cos(theta(x, y, t))^2*dudy*thetadot+(1/4)*cos(theta(x, y, t))^2*dvdx^2-(1/2)*cos(theta(x, y, t))^2*dudy*dvdx+(1/4)*cos(theta(x, y, t))^2*dudy^2)+xi*(cos(theta(x, y, t))^2*dudx+2*cos(theta(x, y, t))*sin(theta(x, y, t))*((1/2)*dvdx+(1/2)*dudy)+sin(theta(x, y, t))^2*dvdy);