29
$\begingroup$

Its sometimes hard to type it if logarithm is not natural and base is not 10, especially if base is variable. So anyone know rules how to type?

$\endgroup$

4 Answers 4

47
$\begingroup$

Two ways I just checked:

Typing log(a,b) gives $\log_a(b)$.

You can also use change-of-base to represent $\log_a(b)$ by log(b)/log(a).

$\endgroup$
11
$\begingroup$

You can also use log_(b)(a) where b is the base.

$\endgroup$
5
$\begingroup$

In their reference, Wolfram|Alpha states the following:

Log[z] gives the natural logarithm of $z$ (logarithm to base $e$).

Log[b,z] gives the logarithm to base $b$.

Michael's answer states this using parenthesis. Note that brackets are formally defined, while parentheses are inferred. Realistically this makes no difference, but for the sake of pedantry.

Additionally, if you search for the term that you need more information on, in this case log, you can get the definition & documentation by hovering over the shortened definition in the bottom corner:

enter image description here

The Wolfram|Alpha reference, provides amazing insight into these type of questions.

$\endgroup$
4
  • 1
    $\begingroup$ That looks like a mathematica help page; are you sure that's wolframalpha syntax and not merely mathematica syntax? $\endgroup$
    – user14972
    Jan 2, 2017 at 5:06
  • $\begingroup$ @Hurkyl They likely have the same syntax in many regards, given that the company Wolfram Research created both Wolfram|Alpha and Mathematica. $\endgroup$
    – esote
    Jan 2, 2017 at 7:12
  • $\begingroup$ doesn't recognize $\endgroup$
    – kelalaka
    Oct 11, 2018 at 6:45
  • $\begingroup$ Yes, it does $\endgroup$
    – esote
    Oct 11, 2018 at 13:52
2
$\begingroup$

You can type in loga(b). This gives the logarithm of b base a

$\endgroup$
1
  • $\begingroup$ Sometimes maybe, but not always. Try logsqrt(2)(2) for example. In contrast, log[sqrt(2),2] is always safe to use. $\endgroup$
    – dxiv
    Jan 2, 2017 at 7:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .