clc, clear all, close all

symbols = {'w', 'z', 'c', 'H_0'};
for i = 1:length(symbols)
    eval([symbols{i}, ' = sym(''', symbols{i}, ''', ''real'');'])
end

dp = c/H_0*2/(1 + 3*w)*(1 - (1 + z)^(-(1 + 3*w)/2));
dA = dp/(1 + z);

zmax = simplify(solve(simplify(diff(dA, z) == 0), z));

text(.5, .5, ['$$z_{max} = ', latex(zmax), '$$'], 'interpreter', 'latex', 'horizontalalignment', 'center', 'fontsize', 16)
