AD+DC=AC, so 20+DC=3x+4, DC=3x-16.
If AD=DC because D is the midpoint of AC, then DC=20 and 3x-16=20, so 3x=36 and x=12.
Therefore AC=20+20=40. Or, since AC=3x+4=3×12+4=36+4=40.
However, if D is not the midpoint of AC, then we don't have enough information in the question.