We determine the equation of state of QCD at finite chemical potential, to order $(mu_B/T)^6$, for a system of 2+1 quark flavors. The simulations are performed at the physical mass for the light and strange quarks on several lattice spacings; the results are continuum extrapolated using lattices of up to $N_t=16$ temporal resolution. The QCD pressure and interaction measure are calculated along the isentropic trajectories in the $(T,~mu_B)$ plane corresponding to the RHIC Beam Energy Scan collision energies. Their behavior is determined through analytic continuation from imaginary chemical potentials of the baryonic density. We also determine the Taylor expansion coefficients around $mu_B=0$ from the simulations at imaginary chemical potentials. Strangeness neutrality and charge conservation are imposed, to match the experimental conditions.