# Is there a quick way to approximate a logarithm in Nernst equation?

The problem is as follows:

In a galvanic cell the cathode is an $$Ag^{+}(1.00\,M)/Ag_{(s)}$$ half-cell. The anode is a standard hydrogen electrode immersed in a buffer solution containing $$0.10\,M$$ benzoic acid $$(C_6H_5COOH)$$ and $$0.050\,M$$ of sodium benzoate $$(C_6H_5COO^{-}Na^{+})$$. The measured cell voltage is $$1.030\,V$$. What is the $$pK_a$$ of benzoic acid?.

What I did to solve this problem was to find the potential for the cell involving the standard hydrogen electrode. At first I was confused because there are three "elements" featured in the problem. One being the silver electrode, the other the standard hydrogen electrode and the other a buffer solution, so I didn't know how to proceed from there.

Then I noticed that to get the constant of equilibrium I only require the concentration of $$[H^{+}]$$ ions as,

$$K_a=\frac{[C_6H_5COO^{-}][H^{+}]}{[C_6H_5COOH]}$$

Therefore to obtain those protons I did this:

The half equations in the cell are:

$$\begin{array}{cc} Ag^{+}+1e^{-}\rightarrow Ag_{(s)}&E^{0}=0.7999\,V\\ H^{+}+1e^{-}\rightarrow \frac{1}{2}H_{2(g)}&E^{0}=0.0000\,V\\ \end{array}$$

Hence the overall reaction for this process would be:

$$E^{0}_{cell}=E_{cathode}-E_{anode}=0.7999-0.0000=0.7999\,V$$

Which is for:

$$Ag^{+}+\frac{1}{2}H_{2}+\rightarrow Ag_{(s)} + H^{+}$$

Hence:

$$E_{cell}=E^{0}-\frac{0.0592}{n}\log\frac{[H^{+}]}{[Ag^{+}]p^{\frac{1}{2}}_{H_{2(g)}}}$$

Since it indicates that the cell potential is $$1.030\,V$$ then:

$$1.030=0.7999-\frac{0.0592}{1}\log\frac{[H^{+}]}{[1](1)^{\frac{1}{2}}}$$

Solving this I'm getting:

$$[H^{+}]=0.000125306\,M$$

Now all that's left is to plug in this value in the equation to get the equilibrium constant:

$$K_a=\frac{[C_6H_5COO^{-}][H^{+}]}{[C_6H_5COOH]}$$

$$[C_6H_5COO^{-}]=0.05\,M$$ and $$[C_6H_5COOH]=0.1\,M$$

Hence:

$$K_a=\frac{(0.05)(1.25306\times 10^{-4})}{(0.1)}=6.2653\times 10^{-5}$$

Therefore the $$pKa$$ of benzoic acid would be:

$$pKa=-\log Ka=-\log\left(6.2653\times 10^{-5}\right)=4.20306$$

Which does seem to be within the value of benzoic acid which I have on different references. But the problem with this method it is that it required the use of logarithm.

Given this situation, does it exist an approximation or anything that can be done right of the bat to get an idea where that value would be?. Does it exist another method which I could use?.

• You can involve Czebysev orthogonal polynomial serie as logarithm approximation.. :-) – Poutnik Mar 20 '20 at 4:54
• How did you come to $[\ce{C6H5COO-}]=[\ce{H+}]=\pu{0.05 M}$ ? It is approximately valid for the acid solution, but not for the solution of the acid and its salt. Rather $[\ce{C6H5COO-}]=[\ce{H+}]+[\ce{Na+}=[\ce{H+}]+\pu{0.05 M}$ – Poutnik Mar 20 '20 at 8:03
• @Poutnik, good answer! Use an orthogonal polynomial if you don't like logs or Taylor series expansion. The question is why avoid logs to begin with? – M. Farooq Mar 20 '20 at 13:23
• @M. Farooq I remember the golden age of the "true programmers", 8bit computers and Z80 Assembler language. I owned the commented source code of ROM content of the legendary Sinclair ZX-Spectrum and noticed Czebyshev orthogonal polynomials ( COP ) were the way how it approximated functions like EXP, LN, SIN and ArcTan. For those not familiar, A polynomial function based on COPs minimizes the maximal approximation error for given function and an approximating polynomial based on them, for the given polynomial order. – Poutnik Mar 20 '20 at 13:31
• 0 @Chris Steinbeck Bell You may use few useful points for rough numerical approximation: Log ( A . 10^N ) = Log ( A ) + N, where A is +1.0 .. +10. Log(1)=0 Log(2)~=0.30 Log(3)~=0.48 Log(5)~=0.70 Log(10)=1 – Poutnik Mar 20 '20 at 13:50

From your comments it seems that you are looking for an approximation of a log. I wish you clarified that in the main question without mentioning calculators. It seemed you just wanted to avoid a calculator for some unknown reasons. As Poutnik states, anyone who can post here, will certainly have access to computers and hence the ability to calculate logs.

A first-hand approximation is $$ln (1+x)$$= $$x-x^2/2+x^3/3-x^4/4+...$$

Use you use a simple ln to log conversion factor in the Nernst equation.

So whatever number you get after dividing the concentrations, subtract "one" from it. This is your $$x$$. Since you are assuming that a calculator or computer is not available, all you need is a paper an pencil to evaluate the right hand side.

No need to memorize anything for logs.

If you can afford a slide rule, https://en.wikipedia.org/wiki/Slide_rule, it can also help as a mechanical calculator. I never used them but Youtube has videos on it.

• @M.Farroq As Poutnik's mentioned in the end this depends on how far are you going with the approximation as the function has slow convergence?. The thing here is that you can use a computer or any technological tool but if later you cannot have access to it for some reason does it exist another way to aleviate this caveat?. From your answer its a yes. By the way i do have a japanese slide rule, but the thing here was to do a quick calculation on the go that you can do in few minutes or something without compromising the answer too much. – Chris Steinbeck Bell Mar 21 '20 at 2:14
• But as I indicated above, galvanic cells in non standard conditions must require resort to Nernst equation and solely to that reason one way or another you might have to deal with them. If you are allowed to modify or set the experiment or whatsoever, perhaps the best choice without avoiding much fuss is to select concentrations which cancel or simplify the logarithm. :) – Chris Steinbeck Bell Mar 21 '20 at 2:16
• At least give Taylor series a try. I do understand your point now. Sorry there is no simple short cut. – M. Farooq Mar 21 '20 at 2:17
• It would benefit the answer to note that concentration of $[H^{+}]$ in these cases are found from SHE (standard hydrogen electrode) and any other electrodes which this is interacting. Am I right with this?. – Chris Steinbeck Bell Mar 21 '20 at 2:19
• About Czebyshev approximation of ln ( 1 + x ), see math.stackexchange.com/questions/2447075/… – Poutnik Mar 21 '20 at 5:18

$$P\{ \ln( 1+x ) \} = \frac{x(6+x)}{6+4x}$$

$$\ln(1) = 0$$, $$\ln(2) = 0.7$$, $$e_\mathrm{max} = 0.00685$$, $$e_\mathrm{max, rel} \lt 1\%$$, $$e_\mathrm{RMS} = 0.00258$$

This is already a good and fast approximation to $$\ln(1+x)$$ and in many applications like realtime displays can be used as a basis for logarithmic scaling with a few minor modifications for integer arithmetic.

Where greater accuracy is required the expression can be optimised by least squares fitting of the coefficients over the range 0-1. This yields:

$$p'\{ \ln( 1+x ) \} = \frac{x \cdot (6 + 0.7662\cdot x)}{5.9897 + 3.7658 \cdot x}$$

$$\ln(1) = 0$$, $$\ln(2) = 0.69358$$, $$e_\mathrm{max} = 4.3E-4$$, $$e_\mathrm{max, rel} \lt 0.1\%$$, $$e_\mathrm{RMS} = 1.5E-4$$

This is about as good as you can get with this simple formula, and these coefficients may be scaled up to suitable integers for use.

Much higher accuracy is possible by starting from a better series:

Define: $$y = x/(2+x)$$, then $$\ln{ \frac{1+y}{1-y} } = 2y + 2y^3/3 + 2y^5/5 + ...$$

$$\ln(1) = 0$$, $$\ln(2) = 0.69300$$, $$e_\mathrm{max} = -0.00014$$

From which the Pade approximation yields:

$$P\{ \ln \frac{1+y}{1-y} \} = \frac{2y*(15 - 4y^2 )}{15 - 9y^2}$$

$$\ln(1) = 0$$, $$\ln(2) = 0.693122$$, $$e_\mathrm{max} = -0.000025$$

Again this expression can also have its coefficients tweaked to improve accuracy over a narrow range still further.