Since AD = DC....then angles CAD and ACD are equal
And angle ACD = 40 = angle CAD
So....angle CDA = 180 - 40 - 40 = 100
So angle ADB = 180 - 100 = 80
And BD = BA.....so angles BAD and ABD are equal
So angle BAD = [ 180 - angle ADB ] / 2 = [ 180 - 80] / 2 = 100/ 2 = 50
So angle BAC = angle CAD + angle BAD = 40 + 50 = 90°