Because you know that segments AD and DC are congruent, that means that DC=20.
You also know that segments AD+DC=AC.
You can plug in all the information you know and begin to solve for x.
AD+DC=AC
20+20=3x+4
40=3x+4
36=3x
12=x
Now we know that:
x=12
AC=40
DC=20