Determination of pKa by absorbance and pH of buffer solutions I've been tasked (as part of a report) to calculate the $\mathrm pK_\mathrm a$ of 4-nitrophenol by measuring the pH and absorbance of six 'buffer solutions' containing the 4-nitrophenol:

$$\begin{array}{cccc}\hline
\text{Solution} &amp; \text{Volume of base / }\pu{cm^3} &amp; \text{Volume of acid / }\pu{cm^3} &amp; \text{Volume of phenol / }\pu{cm^3} \\ \hline
1 &amp; 2.80 &amp; 7.20 &amp; 1.00 \\
2 &amp; 5.00 &amp; 5.00 &amp; 1.00 \\
3 &amp; 6.20 &amp; 3.80 &amp; 1.00 \\
4 &amp; 7.20 &amp; 2.80 &amp; 1.00 \\
5 &amp; 8.70 &amp; 1.30 &amp; 1.00 \\
6 &amp; 10.00 &amp; 0.00 &amp; 1.00 \\ \hline
\end{array}$$

We have to then plot a graph of $\mathrm{pH}$ versus $\log_{10}[A/(A_f-A)]$ and use that graph to calculate $\mathrm pK_\mathrm a$. $\text{A}_{f}$ is the absorbance of Solution 6 - we assume that the weak acid in the buffer is present only as its conjugate base - and A is the absorbance of the buffer solution.

My two questions about this are:
1) Where does the expression $\log_{10}[A/(A_f-A)]$ come from? I thought the derivation would be as follows, which clearly gives a different result ($\text{A}_{f}$ on the numerator rather than $\text{A}$):


  Using the Beer-Lambert Law,
  
  $$
\begin{align}
A &amp;= \epsilon cl \\
c_\text{base} &amp;= \frac{A_{f}}{\epsilon l} \\ 
\end{align}
$$ 
  
  And substituting into the Henderson–Hasselbalch equation:
  
  $$
\begin{align}
\mathrm{pH} &amp;= \mathrm pK_\mathrm a + \log_{10}\left(\frac{[\text{conj. base}]}{[\text{acid}]}\right) \\
\mathrm{pH} &amp;= \mathrm pK_\mathrm a + \log_{10}\left(\frac{A_{f}}{A_{f}-A}\right) \\
\end{align}
$$


2) Once I have the graph, how do I calculate $\mathrm pK_\mathrm a$ from it? Assumed it would be using the gradient of the line of best fit, but that won't work since $\mathrm pK_\mathrm a$ is given by the difference of $\mathrm{pH}$ and $\log_{10}[A/(A_f-A)]$ rather than the quotient.
Make the plot $10^{\mathrm{pH}}(A_{\ce{L-}} - A)$ versus $A$, 
the adjusted equation will be of the form
$$
10^{\mathrm{pH}}(A_{\ce{L-}} - A) 
  = 10^{\mathrm{p}K_\mathrm{a}}A
  - 10^{\mathrm{p}K_\mathrm{a}}A_{\ce{HL}},
$$
the slope is $10^{\mathrm{p}K_\mathrm{a}}$, that is, $\mathrm{p}K_\mathrm{a} = \log_{10}(\text{slope})$.