How to determine the pH of a mixture of two weak acids?
Below a more general approach.

Suppose that we have two weak acids $\ce{HA}$ and $\ce{HB}$.
The initial concentrations are $C^0_\ce{HA}$ and $C^0_\ce{HB}$, and their constants are $K_{\mathrm{a},\ce{(HA)}}$ and $K_{\mathrm{a},\ce{(HB)}}$.
Suppose yet that volumes, $V_\ce{HA}$ and $V_\ce{HB}$, are additives.
So we have:


Reactions


\begin{align}
  \ce{HA + H2O &amp;&lt;=&gt; H3O+ + A-} &amp;
  K_{\mathrm{a},(\ce{HA})} 
    &amp;= \frac{\ce{[H3O+][A-]}}{\ce{[HA]}}
  \tag{1}\label{eq:KAcidHA}\\
  \ce{HB + H2O &amp;&lt;=&gt; H3O+ + B-} &amp;
  K_{\mathrm{a},(\ce{HB})}
    &amp;=\frac{\ce{[H3O+][B-]}}{\ce{[HB]}}
  \tag{2}\label{eq:KAcidHB}\\
  \ce{2 H2O &amp;&lt;=&gt; H3O+ + OH-} &amp;
  K_\mathrm{w} &amp;= \ce{[H3O+][OH-]}\tag{3}\label{eq:KWater}
\end{align}


Mass balance


\begin{align}
  C_\ce{HA} &amp;= \frac{C^0_\ce{HA} V_\ce{HA}}{V_\ce{HA} + V_\ce{HB}}
  &amp;&amp;=\ce{[HA] + [A-]}\tag{4}\label{eq:MassBalanceHA}\\
  C_\ce{HB} &amp;= \frac{C^0_\ce{HB} V_\ce{HB}}{V_\ce{HA} + V_\ce{HB}}
  &amp;&amp;=\ce{[HB] + [B-]}\tag{5}\label{eq:MassBalanceHB}
\end{align}


Charge balance


$$\ce{[H3O+] = [OH-] + [A-] + [B-]}\tag{6}\label{eq:ChargeBalance}$$

Replacing \eqref{eq:KAcidHA}–\eqref{eq:MassBalanceHB} equations on \eqref{eq:ChargeBalance}, we have:
$$
\ce{[H3O+]} = 
  \frac{K_\mathrm{w}}{\ce{[H3O+]}} 
  +\frac{C_\ce{HA} K_{\mathrm{a},(\ce{HA})}}{\ce{[H3O+]} 
  + K_{\mathrm{a},(\ce{HA})}} 
  + \frac{C_\ce{HB} K_{\mathrm{a},(\ce{HB})}}{\ce{[H3O+]} 
  + K_{\mathrm{a},(\ce{HB})}}
\tag{7}\label{eq:GeneralEquation}$$

or as polynomial

\begin{align}
\begin{split}
 &amp;\ce{[H3O+]}^4\\
+&amp;\ce{[H3O+]}^3 (K_{\mathrm{a},(\ce{HA})} 
  + K_{\mathrm{a},(\ce{HB})})\\
+&amp;\ce{[H3O+]}^2 \left[
  K_{\mathrm{a},(\ce{HA})} K_{\mathrm{a},(\ce{HB})} 
  - ( C_\ce{HA} K_{\mathrm{a},(\ce{HA})} 
    + C_\ce{HB}K_{\mathrm{a},(\ce{HB})} ) 
  - K_\mathrm{w} \right]\\
-&amp;\ce{[H3O+]} \left[ 
  (C_\ce{HA} + C_\ce{HB}) K_{\mathrm{a},(\ce{HA})} K_{\mathrm{a},(\ce{HB})} 
  + K_\ce{w} (K_{\mathrm{a},(\ce{HA})} + K_{\mathrm{a},(\ce{HB})}) \right]\\
-&amp; K_{\mathrm{a},(\ce{HA})} K_{\mathrm{a},(\ce{HB})} K_\mathrm{w}\\
=&amp;\ 0
\end{split}\tag{8}\label{eq:GeneralPol}
\end{align}

This single equation will exactly solve any equilibrium problem involving the mixture of any two monoprotic acids, in any concentration (as long as they're not much higher than about $\pu{1 mol L-1}$) and any volume. Depending of $K_\mathrm{a}$, $K_{\mathrm{a},(\ce{HB})}$, $C^0_\ce{HA}$, and $C^0_\ce{HB}$ values, we can yet obtain a simpler version[1]. 

The \eqref{eq:GeneralPol} equation can simplified considering[2] that $K_{\mathrm{a},(\ce{HA})} K_{\mathrm{a},(\ce{HB})} K_\mathrm{w} \ll \ce{[H3O+]}^4$:

\begin{align}
\begin{split}
 &amp;\ce{[H3O+]}^3\\
+&amp;\ce{[H3O+]}^2 (K_{\mathrm{a},(\ce{HA})} + K_{\mathrm{a},(\ce{HB})})\\
+&amp;\ce{[H3O+]}\left[
  K_{\mathrm{a},(\ce{HA})} K_{\mathrm{a},(\ce{HB})} 
  - (C_\ce{HA} K_{\mathrm{a},(\ce{HA})} 
    + C_\ce{HB} K_{\mathrm{a},(\ce{HB})})
  - K_\mathrm{w} \right]\\
-&amp;\left[ 
  (C_\ce{HA} + C_\ce{HB}) K_{\mathrm{a},(\ce{HA})} K_{\mathrm{a},(\ce{HB})} 
  + K_\mathrm{w} (K_{\mathrm{a},(\ce{HA})} + K_{\mathrm{a},(\ce{HB})})
  \right]\\
=&amp;\ 0
\end{split}\tag{9}\label{eq:GeneralPolSimp1}
\end{align}

The \eqref{eq:GeneralPolSimp1} equation can simplified considering[2] that $K_{\mathrm{a},(\ce{HA})} K_{\mathrm{a},(\ce{HB})} \ll \ce{[H3O+]}^3$:

\begin{align}
\ce{[H3O+]}^2 + \ce{[H3O+]} (K_{\mathrm{a},(\ce{HA})} 
  + K_{\mathrm{a},(\ce{HB})})
  - (C_\ce{HA} K_{\mathrm{a},(\ce{HA})}
    + C_\ce{HB} K_{\mathrm{a},(\ce{HB})}+K_\mathrm{w})
= 0\tag{10}\label{eq:GeneralPolSimp2}
\end{align}

The \eqref{eq:GeneralPolSimp2} equation can be solved as usual.

$$\ce{[H3O+]} = 
\frac{
  - (K_{\mathrm{a},(\ce{HA})} + K_{\mathrm{a},(\ce{HB})})
  + \sqrt{
    (K_{\mathrm{a},(\ce{HA})} + K_{\mathrm{a},(\ce{HB})})^2
    + 4 (C_\ce{HA} K_{\mathrm{a},(\ce{HA})} 
      + C_\ce{HB} K_{\mathrm{a},(\ce{HB})}+K_\mathrm{w})}
}{2}$$

Or using the initial concentrations

$$\ce{[H3O+]} =
\frac{
  - (K_{\mathrm{a},(\ce{HA})} + K_{\mathrm{a},(\ce{HB})})
  + \sqrt{
    (K_{\mathrm{a},(\ce{HA})} + K_{\mathrm{a},(\ce{HB})})^2
    + 4\left(%\displaystyle
      \frac{C^0_\ce{HA} V_\ce{HA} K_{\ce{a},(\ce{HA})}
        }{V_\ce{HA} + V_\ce{HB}} 
      + \frac{C^0_\ce{HB} V_\ce{HB} K_{\ce{a},(\ce{HB})}
        }{V_\ce{HA} + V_\ce{HB}}
    +K_\mathrm{w}\right)}
}{2}$$

Replacing $C^0_\ce{HA}=\pu{0.01 mol L-1}$, $C^0_\ce{HB}=\pu{0.01 mol L-1}$, $V_\ce{HA}=\pu{0.050 L}$ and $V_\ce{HB}=\pu{0.050 L}$, and using $\text{p}K_\ce{a}=3.75$ for formic acid and $\text{p}K_\ce{a}=4.756$ for acetic acid[3], we have 
$$\ce{pH}=3.05.$$

Addendum

@MaxW made some warnings about the assumptions which simplificate ($\ref{eq:GeneralPol}$)(see comment) and ($\ref{eq:GeneralPolSimp1}$)(see comment) equations.
To completeness and with the aim of show the limitations of present approach, consider the following graphics.
The ($\ref{eq:GeneralPol}$), ($\ref{eq:GeneralPolSimp1}$), and ($\ref{eq:GeneralPolSimp2}$) equations were solved using $\text{p}K_{\mathrm{a},(\ce{HA})}=\text{p}K_{\mathrm{a},(\ce{HB})}$, $C^0_\ce{HA}=C^0_\ce{HB}$, and $V_\ce{HA}=V_\ce{HB}=\pu{50.0 mL}$.










As we can see, the ($\ref{eq:GeneralPolSimp1}$) equation can be used on any $\text{p}K_\ce{a}$ values, inasmuch as the concentration be major of $\pu{1E-6 mol L-1}$.
The ($\ref{eq:GeneralPolSimp2}$) equation becomes problematic when dilute solutions or strong acids solutions are used.

Thus, when applied to book-examples, which $\text{p}K_\ce{a}$ values from 3 to 6, and the concentrations from $1.0$ to $\pu{1.0E-4 mol L-1}$, the assumptions are valid and the equations can be used, providing good approximations of $\ce{pH}$ values.

Acknowledgement

Thanks to @MaxW for draw attention to limitations of assumptions.

Reference


Edited based on first @MaxW's comment.
Edited based on second @MaxW's comment.
Haynes, W. M.;  Lide, D. R.; Bruno, T. J., CRC Handbook of Chemistry and Physics. 97 ed.; CRC Press: 2017; pp. 5–88.