# Trouble with using a log10 function in NonlinearModelFit

I was wondering why won't mathematica give a result where the function is also Log10, instead it gives the ordinary Log. Is it because the Log fits the problem better than the Log10 or... ?

Clear[x, a, b, c, d]

Data = {{0, 0}, {1, 6.91}, {2, 9.2}, {3, 11.4}, {4, 13.4}, {24,
39}, {25, 40.5}};

aa = NonlinearModelFit[Data, {a + b*Log10[c*x + d], c > 0, d > 0}, {a, b, c, d}, x];

aa // Normal

Show[Plot[aa[x], {x, 0, 100}, PlotRange -> All], ListPlot[Data, PlotStyle -> Directive[Red, PointSize[0.02]]]]


The natural logarithm is the logarithm of mathematics. Hence, that's what Mathematica will use in results where a logarithm is present.

You can transform the expression if you really need to "see" things using common log, e.g. (many ways to do this, and see Rahul's comment on an equivalent result...):

Replace[Normal@aa, Log[val_] :> Defer[Log10[val^Log[10]]], Infinity]

• I feel Log[val_] :> Log[10] Defer[Log10[val]] is more what is desired: $-75.4281+47.393 \log _{10}(9.28813 x+41.0739)$ rather than $-75.4281+20.5825 \log _{10}\left((9.28813 x+41.0739)^{\log 10}\right)$.
– user484
Jun 6, 2014 at 8:12
• @RahulNarain: You're probably right, since they're equivalent I suppose it depends where one wants the Log[10] to appear...
– ciao
Jun 6, 2014 at 8:22