MATLAB's "int" only returns one possible antiderivative.
If you want to show the free integration constants, you could use "dsolve" which is usually used for the symbolic solution of more complicated ordinary differential equations:
y1 = exp(-2*x+sqrt(6)*x);
y2 = exp(-2*x-sqrt(6)*x);
A = [y1 y2;diff(y1,x) diff(y2,x)]
A =

b = [0; g]
b =

A\b
ans =

u = simplify(A\b)
u =

u = dsolve(diff(v,x)==u);
simplify(u.v1)
ans =

●
simplify(u.v2)
ans =
