Before swinging, T has only potential energy, (no speed)
Ui = mgh
Where h is the vertical displacement of T
From the laws of geometry,
cos45 = (L-h)/L
cos45 = 1-h/L
h/L = 1-cos45
h = L(1-cos45)
Therefore
Ui = mgL(1-cos45)
Proceeding the same way,
Twill raise to aheight of h' due to swing
h' = L(1-cos30)
The PE of T after swing is
Uf = mgh'
Uf = mgL(1-cos30)
Along with the PE , T has some kinetic energy results due to the moment.
Tf = 0.5*mv^2
According to the law of conservation of energy,
Ui = Uf+Tf
mgL(1-cos45) = mgL(1-cos30) + 0.5*mv^2
gL(co30-cos45) = 0.5*v^2
9.8*20*(co30-cos45) = 0.5*V^2
v = 7.89 m/s
The speed f T after swing is 7.89 m/s